ITADN

Using sub for 1 - 1/3 returns 0

#88OpenRHP9J7uGrcq 创建于 2025-05-16
R
RHP9J7uGrcqcommented
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 条评论