-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Please correct me if I'm wrong.
I realised the decimals are being chopped off when creating a new instance of a string and then converting it back to a string (with or without any additional methods used).
const price = "10.50";
console.log(price); // 10.50
const bn = new BN(price);
console.log(bn.toString(10)); // 10
const bn2 = new BN(price, 10);
console.log(bn2.toString(10)); // 10
console.log(bn.mul(new BN(3)).toString(10)) // 30
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working