A simple js utility to format numbers to Stripe's smallest common currency unit format
Supports most International Curriences.
import StripeMoneyFormat from "stripe-money-format";
const number = 86753.09;
console.log(StripeMoneyFormat.toStripeFormat(number)); // 8675309
const {toStripeFormat} = require("stripe-money-format");
const number = 86753.09;
console.log(toStripeFormat(number)); // 8675309
Should support any currency available to the node Intl package: Intl.NumberFormat
import StripeMoneyFormat from "stripe-money-format";
const number = 123456.789;
const currency = "EUR";
const language = "de-DE";
console.log(toStripeFormatCustomCurrency(currency, language, number)); // 12345679
const {toStripeCustomCurrency} = require("stripe-money-format");
const number = 123456.789;
const currency = "EUR";
const language = "de-DE";
console.log(toStripeCustomCurrency(currency, language, number)); // 12345679