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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.5
    156
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.5
    156
  • 0.0.4
    0
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i currency-decimal-places

Weekly Downloads

156

Version

0.0.5

License

ISC

Unpacked Size

7.18 kB

Total Files

5

Last publish

Collaborators

  • gabsima-nexapp