django_stripe/static/js/django_stripe/formatters.js
// Format a price (assuming a two-decimal currency like EUR or USD for simplicity).
Format a price (assuming a two-decimal currency like EUR or USD for simplicity).
Format a price ( assuming a two - decimal currency like EUR or USD for simplicity ) .
function formatPrice(amount, currency) {
    let price = (amount / 100).toFixed(2);
    let numberFormat = new Intl.NumberFormat(['en-US'], {
      style: 'currency',
      currency: currency,
      currencyDisplay: 'symbol',
    });
    return numberFormat.format(price);
  }
function formatPrice ( amount , currency ) { let price = ( amount / 100 ) . toFixed ( 2 ) ; let numberFormat = new Intl . NumberFormat ( [ 'en-US' ] , { style : 'currency' , currency : currency , currencyDisplay : 'symbol' , } ) ; return numberFormat . format ( price ) ; }
Format a price (assuming a two-decimal currency like EUR or USD for simplicity).
Format a price ( assuming a two - decimal currency like EUR or USD for simplicity ) .