Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
Convert a string to number with parseInt does not work as expected

A quick maybe simple question :

We are trying to parse a string into number , the sample number is "1928433000460244141" so when we try to parse it to integer we get 1928433000460244200

const no1 = "1928433000460244141" ;
console.log(parseInt(no1)); // returns 1928433000460244200

what can cause this problem and what is the solution ?

BigInt can be used to store the data , but the problem is we want to send the string converted to number to a service we are using right now , we do not have any access hence it is a 3rd party service so we should handle it from our side.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The MAX_SAFE_INTEGER constant has a value of 9007199254740991 (9,007,199,254,740,991 or ~9 quadrillion). The reasoning behind that number is that JavaScript uses double-precision floating-point format numbers as specified in IEEE 754 and can only safely represent integers between -(2^53 - 1) and 2^53 - 1.

Source

Because your number is larger than the safe integer limit, you're likely experiencing some floating-point precision issues that are rounding the value off.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!