currency-decimal-places
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

currency-decimal-places

In order to convert easily money amounts in whole integer to their original amounts. The list is based off of wikipedia

Usage

import {getDecimalPlacesForCurrency} from "@nexapp/currency-decimal-places"


const currency = "CAD" // ISO 4217 currency code (3 letters)
const decimalPlaces = getDecimalPlacesForCurrency(currency)
// decimalPlaces is 2, you can use money libraries like Dinero to convert a cent amount to the desired decimal format

Readme

Keywords

none

Package Sidebar

Install

npm i currency-decimal-places

Weekly Downloads

184

Version

0.0.5

License

ISC

Unpacked Size

7.18 kB

Total Files

5

Last publish

Collaborators

  • gabsima-nexapp