Ratio.js
Ratio.js copied to clipboard
Make Ratio.cleanFormat() more generic
Rather than just focusing on scientific notated numbers, add a function Ratio.getCleanFormat that rounds numbers appropriately.
So in Ratio.prototype.cleanFormat change it
From:
obj.numerator = Ratio.getCleanENotation( obj.numerator );
obj.denominator = Ratio.getCleanENotation( obj.denominator );
To:
obj.numerator = Ratio.getCleanFormat( obj.numerator );
obj.denominator = Ratio.getCleanFormat( obj.denominator );
Are better yet should .reduce() replace .cleanFormat()?