diff --git a/common/util/format.ts b/common/util/format.ts index 10b7c1de..decdd55d 100644 --- a/common/util/format.ts +++ b/common/util/format.ts @@ -12,6 +12,10 @@ export function formatMoney(amount: number) { return ENV_CONFIG.moneyMoniker + formatter.format(newAmount).replace('$', '') } +export function formatMoneyWithDecimals(amount: number) { + return ENV_CONFIG.moneyMoniker + amount.toFixed(2) +} + export function formatWithCommas(amount: number) { return formatter.format(Math.floor(amount)).replace('$', '') } diff --git a/web/components/bet-panel.tsx b/web/components/bet-panel.tsx index aaca3ffb..73055872 100644 --- a/web/components/bet-panel.tsx +++ b/web/components/bet-panel.tsx @@ -10,6 +10,7 @@ import { Spacer } from './layout/spacer' import { YesNoSelector } from './yes-no-selector' import { formatMoney, + formatMoneyWithDecimals, formatPercent, formatWithCommas, } from 'common/util/format' @@ -347,7 +348,9 @@ function BuyPanel(props: { {cpmmFees !== false && ( - + )} {dpmTooltip && }