Forum Discussion

sothqamb's avatar
Occasional Contributor
2 years ago

What datatype to use for integers of size 10^18

My TC Project is using JavaScript and I am trying to retrieve the ID number with a magnitude of 10^18 from a database. I have not had any luck since the MAX_SAFE_INTEGER is round 9*10^15. Is there any inbuilt datatypes like BigInt available to store the ID's, and if not, how would you import a library to do so?

1 Reply

  • Marsha_R's avatar
    Champion Level 3

    Do you need it to be a number in your test (i.e. are you doing math with it)?  If not, could you store it in a string variable? Not sure if that would work but it is something I would try if I was working on it.