Socket
Socket
Sign inDemoInstall

stripe-money-format

Package Overview
Dependencies
18
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stripe-money-format

A simple utility to format numbers to stripe's smallest common currency unit format


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Stripe Money format

A simple js utility to format numbers to Stripe's smallest common currency unit format

Supports most International Curriences.

Usage

ES6

import StripeMoneyFormat from "stripe-money-format";

const number = 86753.09;
console.log(StripeMoneyFormat.toStripeFormat(number)); // 8675309

CommonJS

const {toStripeFormat} = require("stripe-money-format");

const number = 86753.09;
console.log(toStripeFormat(number)); // 8675309

International Currency Support

Should support any currency available to the node Intl package: Intl.NumberFormat

ES6 Example

import StripeMoneyFormat from "stripe-money-format";

const number = 123456.789;
const currency = "EUR";
const language = "de-DE";

console.log(toStripeFormatCustomCurrency(currency, language, number)); // 12345679

Common JS Example

const {toStripeCustomCurrency} = require("stripe-money-format");

const number = 123456.789;
const currency = "EUR";
const language = "de-DE";

console.log(toStripeCustomCurrency(currency, language, number)); // 12345679

Keywords

FAQs

Last updated on 12 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc