I am trying to convert a string with more than 16 digit to number. But in javascript it is not allowed according to various article I read. Reference of some are here How to convert a long string (more than 16 digits) into numbers
facing an issue with parseFloat when input is more than 16 digits
https://2ality.com/2012/07/large-integers.html
Below is the code I tried.
let x= "123456789123456789"
console.log(parseInt(x))
console.log(parseFloat(x))
console.log(Number(x))
console.log(+x)
let y= "1234567891234567.34"
console.log(parseInt(y))
console.log(parseFloat(y))
console.log(Number(y))
console.log(+y)
I want the exact numbers as I use string to display in ContentEditable field and when I save the data I need to pass it as a number. As it is related to banking the same numbers are important.
Is there any way I can solve this issue or any library I can use to solve this problem