Using sub for 1 - 1/3 returns 0
When I have a fraction 1/1 and I sub 1/3, it produces 2/3, but the toString is 0.(6).
I am doing this:
parseFloat(fraction.sub(fraction2).toString())
Why is toString not returning a proper decimal? I can work around this with a regex on the decimal to get the digits and decimal point.
2 条评论