DonationOption: appropriately format amounts
This commit is contained in:
parent
d8bacbeeef
commit
3d631b6c30
1 changed files with 6 additions and 1 deletions
|
@ -4,12 +4,17 @@
|
|||
export let send: (amount: number) => void;
|
||||
|
||||
const click = () => send(price * 100);
|
||||
const USD = new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: 'USD',
|
||||
minimumFractionDigits: 0
|
||||
});
|
||||
</script>
|
||||
|
||||
<button class="donation-option" on:click={click}>
|
||||
<div class="donate-card-title">
|
||||
<slot></slot>
|
||||
${price}
|
||||
{ USD.format(price) }
|
||||
</div>
|
||||
<div class="donate-card-subtitle">{desc}</div>
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue