question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SimpleMaskMoney.format(0.1) returns `0.01`

See original GitHub issue

Apparently any number smaller than 1 with 1 decimal place is returning a number divided by 10.

SimpleMaskMoney.format(0.1)
//=> "0,01"
SimpleMaskMoney.format(0.11)
//=> "0,11"
SimpleMaskMoney.format(0.9)
//=>  "0,09"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
codermarcoscommented, Feb 22, 2019

This feature was included in the v3.0.0

1reaction
joaofelipermcommented, Sep 20, 2018

@codermarcos @fnando I have found the same problem with a number more than 1.

SimpleMaskMoney.format(1.2) //=> "0,12"

Read more comments on GitHub >

github_iconTop Results From Across the Web

simple-mask-money - npm
Start using simple-mask-money in your project by running `npm i ... This method return value of your input in format number to save...
Read more >
Simple-mask-money NPM - npm.io
Check Simple-mask-money 3.0.1 package - Last release 3.0.1 with Apache-2.0 ... args); // This method return value of your input in format number...
Read more >
Javascript input mask currency | Learn-codes.net
function formatNumber(n) { // format number 1000000 to 1,234,567 return ... Money(Currency) Mask Library In Vanilla JavaScript – SimpleMaskMoney.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found