Ratio.js
Ratio.js copied to clipboard
Support for different ways of expressing ratios in text (alternative divSigns)
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).
Ok. I'll look into this. Give me 2 weeks. :-)