Skip to content

Commit

Permalink
fix nv
Browse files Browse the repository at this point in the history
  • Loading branch information
lagden committed Oct 21, 2023
1 parent a7a0c6f commit 5a2984a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tadashi/currency",
"version": "3.3.0",
"version": "3.3.1",
"description": "The simple and tiny script for currency input mask",
"keywords": [
"currency",
Expand Down
5 changes: 4 additions & 1 deletion src/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ class Currency {

const nv = Number(v)
if (Number.isNaN(nv) === false && viaInput === false) {
v = new Intl.NumberFormat('en-US', {minimumFractionDigits: 2}).format(nv)
v = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}).format(nv)
}

const {
Expand Down

0 comments on commit 5a2984a

Please sign in to comment.