LarryBattle / Ratio.js

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

Support for different ways of expressing ratios in text (alternative divSigns) #53

Open jsmreese opened 10 years ago

jsmreese commented 10 years ago

There are a few standard ways of writing ratios that aren't parsed properly. Using a colon 3:2 Using an 'x' 3x2 others?

Ratio("3:2"); and Ratio("3x2"); should parse into a ratio just as Ratio("3/2"); does.

When parsed using an alternative divSign, that divSign should be set on the instantiated Ratio object.

When a Ratio has a divSign that is not a forward slash '/', the Ratio's divSign should be preserved through methods that create new Ratio objects (any method that uses .clone() internally).

LarryBattle commented 10 years ago

Ok. I'll look into this. Give me 2 weeks. :-)