From 74dac1003d6ab6093cc48a7854219cc94680cfbb Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 5 Nov 2024 13:31:53 -0800 Subject: dark styles --- src/components/Numpad.svelte | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/components/Numpad.svelte') diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 694f5754..07d1ef4c 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -181,6 +181,18 @@ let keydown = (e) => e.key === "Enter" && (e.preventDefault() || submit.click()); + + let swap = () => { + if (fiat) { + amount = parseInt((amountFiat / (rate / sats)).toFixed(0)); + } else { + amountFiat = + (amount * (rate / sats)).toFixed(2) > 0.0 + ? (amount * (rate / sats)).toFixed(2) + : 0; + } + fiat = !fiat; + };
@@ -204,24 +216,11 @@ bind:this={element} />
-
- {fiat ? "⚡️" + s(amount) : f(amountFiat, currency)} - +
+ {fiat ? "⚡️" + s(amount) : f(amountFiat, currency)}
-- cgit v1.2.3