not sure if there’s a simple answer for this one. Well, I’m building a system / data base that I want to handle any kind of number in one field. Well, not sure if I need to give the specifics on the database structure, since the problem that I’m having, I’m able to replicate with a string.
I’m making a test with this number:
12312312312312312312312311.000000000000000000000000000000
But keep in mind that I’m looking for a solution that could handle also this number:
12312312312312312312312311.987987987987987987987987987987
My idea is to print out this exact value for both cases. But on the first case, print out:
12312312312312312312312311
So far, I’ve researched Stack Overflow and found this post:
How to avoid scientific notation for large numbers in JavaScript?
I’ve tried out some of the solutions, but none of them worked the way I expected.
I’ve also tried the following solution:
BigInt(12312312312312312312312311.000000000000000000000000000000)
But it prints out: 12312312312312311989665792 (very strange, by the way)
Anyone has any idea I could try out?
Thanks,