Add trailing zeros to cents when focus moves

This commit is contained in:
leigh-mil
2019-02-01 10:25:34 -05:00
parent 0382966929
commit 63bcae0bd4
3 changed files with 14 additions and 5 deletions

View File

@@ -4,6 +4,11 @@ export const formatDollars = (value, cents = true) => {
style: 'currency',
currency: 'USD',
})
} else if (typeof value === 'string') {
return parseFloat(value).toLocaleString('us-US', {
style: 'currency',
currency: 'USD',
})
}
return ''
}