diff options
| author | Adam Soltys <[email protected]> | 2024-11-29 11:38:38 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-29 11:38:38 -0800 |
| commit | 50c983c537d185db79cefd211c0e3231c8ac0234 (patch) | |
| tree | 7cbae6cd5bb1cd2ed18176af2ae990839b843bbb /src/components/Numpad.svelte | |
| parent | 9a79bd02db31c19ae5692176926698f11eb828e1 (diff) | |
| download | coinos-ui-50c983c537d185db79cefd211c0e3231c8ac0234.tar.gz coinos-ui-50c983c537d185db79cefd211c0e3231c8ac0234.zip | |
strip commas on paste
Diffstat (limited to 'src/components/Numpad.svelte')
| -rw-r--r-- | src/components/Numpad.svelte | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 85f4b07f..a0c5260f 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -15,6 +15,10 @@ export let amountFiat = 0; + let pasted = async () => { + html = (await navigator.clipboard.readText()).replace(/,/g, ""); + }; + function getCurrencyInfo(locale = "en-US", currency) { const formatter = new Intl.NumberFormat(locale, { style: "currency", @@ -207,6 +211,7 @@ use:focus contenteditable bind:innerHTML={html} + on:paste={pasted} on:focus={select} on:blur={blur} on:input={input} |
