Show one decimal point on clips

This commit is contained in:
Austin Chen 2022-06-14 03:44:14 -07:00
parent 8d97eb6f63
commit 6614833cb1

View File

@ -7,9 +7,13 @@ const formatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 0,
})
// export function formatMoney(amount: number) {
// const newAmount = Math.round(amount) === 0 ? 0 : Math.floor(amount) // handle -0 case
// return ENV_CONFIG.moneyMoniker + formatter.format(newAmount).replace('$', '')
// }
export function formatMoney(amount: number) {
const newAmount = Math.round(amount) === 0 ? 0 : Math.floor(amount) // handle -0 case
return ENV_CONFIG.moneyMoniker + formatter.format(newAmount).replace('$', '')
return ENV_CONFIG.moneyMoniker + amount.toFixed(1)
}
export function formatWithCommas(amount: number) {