mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-04 06:06:07 +00:00
DonationOption: appropriately format amounts
This commit is contained in:
parent
d8bacbeeef
commit
3d631b6c30
|
@ -4,12 +4,17 @@
|
||||||
export let send: (amount: number) => void;
|
export let send: (amount: number) => void;
|
||||||
|
|
||||||
const click = () => send(price * 100);
|
const click = () => send(price * 100);
|
||||||
|
const USD = new Intl.NumberFormat('en-US', {
|
||||||
|
style: 'currency',
|
||||||
|
currency: 'USD',
|
||||||
|
minimumFractionDigits: 0
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button class="donation-option" on:click={click}>
|
<button class="donation-option" on:click={click}>
|
||||||
<div class="donate-card-title">
|
<div class="donate-card-title">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
${price}
|
{ USD.format(price) }
|
||||||
</div>
|
</div>
|
||||||
<div class="donate-card-subtitle">{desc}</div>
|
<div class="donate-card-subtitle">{desc}</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in a new issue