From cfa8570d59cbf89bc83b4ab9a6264ff776b1af90 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 13 Mar 2023 00:49:08 -0700 Subject: order of operations --- src/routes/(app)/[username]/payments/[...page]/+page.svelte | 8 ++++---- src/routes/(app)/payment/[id]/+page.svelte | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index 84891b92..aa2ad72b 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -60,11 +60,11 @@ payments = payments.map((p) => ({ ...p, created: new Date(p.created), - total: p.amount + p.tip || 0, + total: p.amount + (p.tip || 0), amount_fiat: f((p.amount * p.rate) / sats, p.currency), fee_fiat: p.fee ? f((p.fee * p.rate) / sats, p.currency) : null, tip_fiat: p.tip ? f((p.tip * p.rate) / sats, p.currency) : null, - total_fiat: f(((p.amount + p.tip || 0) * p.rate) / sats, p.currency) + total_fiat: f(((p.amount + (p.tip || 0)) * p.rate) / sats, p.currency) })); let keys = [ @@ -147,8 +147,8 @@
-
- {f((Math.abs(p.amount) + p.tip || 0) * (p.rate / sats), p.currency)} +
+ {f((Math.abs(p.amount) + (p.tip || 0)) * (p.rate / sats), p.currency)} {#if p.tip} {f(Math.abs(p.amount) * (p.rate / sats), p.currency)} + {f( diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index c3f8cdf0..34e2d327 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -61,8 +61,8 @@
Total
- {f(fiat(a + tip || 0, rate), currency)} - ⚡️{`${s(a + tip || 0)}`} + {f(fiat(a + (tip || 0), rate), currency)} + ⚡️{`${s(a + (tip || 0))}`}
{/if} -- cgit v1.2.3