Js deals with the problem of large numbers

in js, there is a number 12345678901234.123456. The result can only display 12345678901234.123.
is truncated when it is formatted.

""+12345678901234.123456;//12345678901234.123
(12345678901234.123456).toString();//12345678901234.123

I wonder if there is any way to keep this original number? Even if it is converted to a string.

Jul.10,2022

var a = new String ('12345678901234.12345')


(12345678901234.123456)-1234567890123400.123046875
precision has been lost, so don't take it as a digital storage


in the first place.
> Number.isSafeInteger(12345678901234.123456)
> false

this is no longer a safe number for js .

> Number.MAX_SAFE_INTEGER
> 9007199254740991

if it is an integer, you can refer to the number calculation that exceeds the JavaScript safe integer limit-BigInt , but the decimal number may be...


starts with


uses BigNumber to process

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-1b42366-2c5dd.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-1b42366-2c5dd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?