From 7679849c7dd3cf029770726cab0bce024b7b6c9f Mon Sep 17 00:00:00 2001 From: mantikoros Date: Fri, 17 Jun 2022 16:28:12 -0500 Subject: [PATCH] show 2 decimal places for fees --- common/util/format.ts | 4 ++++ web/components/bet-panel.tsx | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 && }