UziTech / number-string

Node module to format number to string

Home Page:https://www.npmjs.com/package/number-string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toMoney function rounding number if it's more than 6 decimal places

Mnigos opened this issue · comments

can you provide the code and expected, actual result?

const val = 1,9856937503769

toMoney(val, {
    decimalMark: '.',
    thousandSeparator: ' ',
    minPrecision: val.length,
    maxPrecision: val.length,
    symbol: '$',
    symbolBehind: false,
    useParens: true,
  })

I expect 1,9856937503769 that number, but got 1,9856940000.

That looks like a limitation of the JavaScript engine not this package.

Nope this is package limitation. I recode this function and it works fine.

How did you recode it?

should be fixed in v2