aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app.js b/src/app.js
index 208af57..259c06f 100644
--- a/src/app.js
+++ b/src/app.js
@@ -632,7 +632,19 @@ function sendForm() {
value: s.max
? (s.unit === 'sats' ? String(estimatedMaxSats()) : fmtBtc(estimatedMaxSats()))
: s.amount,
- onInput: (e) => (s.amount = e.target.value),
+ onInput: (e) => {
+ let v = e.target.value;
+ // Chrome emits scientific notation (e.g. "1e-8") when stepping tiny
+ // BTC amounts — normalize it back to a plain decimal string.
+ if (v && /e/i.test(v)) {
+ const n = Number(v);
+ if (isFinite(n)) {
+ v = s.unit === 'sats' ? String(Math.round(n)) : n.toFixed(8).replace(/\.?0+$/, '');
+ e.target.value = v;
+ }
+ }
+ s.amount = v;
+ },
}),
h(
'div',