Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we convert scientific notation to number in Javascript

So if I do 712569312664357328695151392 + 8100824045303269669937 I want the result to be:

712577413488402631964821329

But instead I have

7.125774134884027e+26

like image 205
Gini Avatar asked Apr 11 '26 15:04

Gini


1 Answers

let a = 712569312664357328695151392;
let b = 8100824045303269669937;

(BigInt(a) + BigInt(b)).toString() will give you your expected result.

like image 111
DhanteyUD Avatar answered Apr 14 '26 03:04

DhanteyUD



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!