mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +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;
|
||||
|
||||
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