Floating point operation precision lost js

it is found that there is a bit of pit in js, and the precision of large floating point number operation will be lost, and the calculation result is not accurate

.

is there any way to solve this problem

Feb.20,2022

one of the characteristics of the JS language.
look at my screenshot of this thing, not to mention your calculation. It is best not to calculate floating point numbers at the front end, especially those involving the amount of money.

clipboard.png

for a more complete solution, you need to install a 1k package: https://github.com/nefe/numbe.

.

popular science learning articles ="

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5089f-450b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5089f-450b6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?