From this post: How to deal with floating point number precision in JavaScript?
You have a few options:
(Math.floor(y/x) * x).toFixed(2)
1.4m articles
1.4m replys
5 comments
57.0k users