Example: convert calculated integer answer 24.025724 into 24.03
For the time being, I convert all decimal numbers into whole numbers to do the calculations by multiplying them by 100, then divide the answer by 100. The .toFixed method is used to remove the trailing decimals. A similar method is posted on StackOverflow: Precise Financial Calculation in JavaScript. What Are the Gotchas?
Is there a simpler way than this?
Coding language: JavaScript (vanilla) Skill level: Beginner Editor: Visual Studio Code OS: Windows 7