Gini
Gini

Reputation: 121

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

Upvotes: 3

Views: 5133

Answers (1)

DhanteyUD
DhanteyUD

Reputation: 81

let a = 712569312664357328695151392;
let b = 8100824045303269669937;

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

Upvotes: 2

Related Questions