Closed valerashylin closed 5 years ago
let a = new bigDecimal('0.11005')
let b = new bigDecimal('0.1')
console.log(a.divide(b))
console.log(bigDecimal.divide('0.11005', '0.1'))
console.log(bigDecimal.divide(bigDecimal.round('0.11005', 16), bigDecimal.round('0.1', 16)))
bigDecimal { value: '11005.00000000' }
11005.00000000
1.10050000
@gaoming13 and @valerashylin Deployed patch for the reported issues. Sorry for the delay. Please use v1.2.2 and let know.
Inconsistency in treating decimal digits in division:
Thus, bigDecimal.divide('2.00', '0.5') = 40.00000000 However, bigDecimal.divide('2.00', '0.50') = 4.00000000
Workaround: bigDecimal.divide( bigDecimal.round('2.00', 2), bigDecimal.round('0.5', 2)) = 4
npm
bigdecimal v.1.2.1