MikeMcl / decimal.js

An arbitrary-precision Decimal type for JavaScript
http://mikemcl.github.io/decimal.js
MIT License
6.35k stars 480 forks source link

Problem of conversion in the Russian locale #191

Closed de-don closed 2 years ago

de-don commented 2 years ago

There is a problem in Russian locale:

const d1 = new Decimal('0.05');
const stringValue = d1.toString();
console.log(stringValue)
// Output: 0,05 (with comma);

const d2 = new Decimal(stringValue);
// ERROR Error: Uncaught (in promise): Error: [DecimalError] Invalid argument: 0,05

decimal.js@10.3.1

image

de-don commented 2 years ago

Oh no, it's my fault.