formatAmounts wip

This commit is contained in:
Mikhail Mikheev 2019-10-01 19:25:10 +04:00
parent 969a389836
commit b3b4887fdb
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
// @flow
export const formatAmount = (number: string | number) => {
let numberFloat = parseFloat(number)
if (numberFloat < 999.999999) {
numberFloat = numberFloat.toFixed(2).toLocaleString()
}
return numberFloat
}