peterolson / BigInteger.js

An arbitrary length integer library for Javascript
The Unlicense
1.12k stars 187 forks source link

Omitting leading zeros when splitting segments from string #174

Closed jaredgorski closed 5 years ago

jaredgorski commented 5 years ago

I'm trying to use bigInt to parse a big integer back and forth from being a string, but a zero is being lost.

screen shot 2019-03-04 at 3 42 54 pm
peterolson commented 5 years ago

You're directly trying to parse the value property? It's only used internally.

I don't see any issue happening with toString:

var x = "1551726003360588900"
bigInt(x).toString() === x // true
jaredgorski commented 5 years ago

Ah, thanks for checking. I'll make sure. Closing for now