diff options
| author | Adam Soltys <[email protected]> | 2024-11-28 14:02:31 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-28 14:02:31 -0800 |
| commit | 67e26efeb6f0c7cc2d4dfbd91f30ff0a158991e6 (patch) | |
| tree | ffa25df2bc3a4fdb9ffaa64fa52f0567ed8a6f00 /src/routes/(app)/payments | |
| parent | 132e6003a42d2dcd39a8786648b4c652d888cd97 (diff) | |
| download | coinos-ui-67e26efeb6f0c7cc2d4dfbd91f30ff0a158991e6.tar.gz coinos-ui-67e26efeb6f0c7cc2d4dfbd91f30ff0a158991e6.zip | |
number formatting
Diffstat (limited to 'src/routes/(app)/payments')
| -rw-r--r-- | src/routes/(app)/payments/[...page]/+page.svelte | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/routes/(app)/payments/[...page]/+page.svelte b/src/routes/(app)/payments/[...page]/+page.svelte index 91b74d98..5625c8de 100644 --- a/src/routes/(app)/payments/[...page]/+page.svelte +++ b/src/routes/(app)/payments/[...page]/+page.svelte @@ -24,6 +24,7 @@ } = $derived(data); let locale = locales[user.language]; + let userLocale = loc(user); let change = ({ target: { value } }) => goto(value); let link = (p) => { @@ -216,12 +217,12 @@ width="24" class="text-yellow-300" ></iconify-icon> - <div>{s(Math.abs(p.amount))}</div> + <div>{s(Math.abs(p.amount), userLocale)}</div> </div> </div> <div class="text-secondary flex items-center text-base"> - {f(Math.abs(p.amount) * (p.rate / sats), p.currency, loc(user))} + {f(Math.abs(p.amount) * (p.rate / sats), p.currency, userLocale)} {#if p.tip} <span class="text-sm text-secondary"> @@ -311,7 +312,7 @@ <span class="text-base text-secondary"> {#if tipsIn || tipsOut}{$t("payments.tips")}{/if} </span> - <span class="text-base text-secondary">{$t("payments.total")}</span> + <span class="text-base text-secondary text-right">{$t("payments.total")}</span> {@const totalIn = incoming[c]?.fiat || 0} {@const tipsIn = incoming[c]?.fiatTips || 0} @@ -325,15 +326,15 @@ >{$t("payments.income")}</span > <!-- <span><b>{subtotalIn ? f(subtotalIn, c) : "-"}</b></span> --> - <span><b>{tipsIn ? f(tipsIn, c, loc(user)) : "-"}</b></span> - <span><b>{totalIn ? f(totalIn, c, loc(user)) : "-"}</b></span> + <span><b>{tipsIn > 0 ? f(tipsIn, c, userLocale) : "-"}</b></span> + <span class="text-right"><b>{totalIn > 0 ? f(totalIn, c, userLocale) : "-"}</b></span> <span class="text-left text-base text-secondary" >{$t("payments.expenditure")}</span > <!-- <span><b>{subtotalOut ? f(subtotalOut, c) : "-"}</b></span> --> - <span><b>{tipsOut ? f(tipsOut, c, loc(user)) : "-"}</b></span> - <span><b>{totalOut ? f(totalOut, c, loc(user)) : "-"}</b></span> + <span><b>{tipsOut > 0 ? f(tipsOut, c, userLocale) : "-"}</b></span> + <span class="text-right"><b>{totalOut > 0 ? f(totalOut, c, userLocale) : "-"}</b></span> {/each} </div> </div> |
