LarryBattle / Ratio.js

Rational numbers for Javascript
http://larrybattle.github.com/Ratio.js/
MIT License
113 stars 9 forks source link

.toEditableString() function #55

Open m1sta opened 10 years ago

m1sta commented 10 years ago

It'd be really handy if there were a .toEditableString() function that returned something like "5 + 7/26" when called. Looking at the behaviour of the current functions, it might just be a minor change to toLocaleString().

I can imagine such a thing being useful when users were presented with ways of editting numbers best represented as fractions or known irrationals.

LarryBattle commented 10 years ago

I'm not sure if that's useful for most people. Could you elaborate more on the use case?

mwaschkowski commented 10 years ago

I've just starting working on an application related to steel working and its done using fractions everywhere, and I have to store the fractions in the database and then retrieve and show them as fractions, so this would be very helpful.