Socket
Book a DemoInstallSign in
Socket

currency-decimal-places

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

currency-decimal-places

In order to convert easily money amounts in whole integer to their original amounts. The list is based off of [wikipedia](https://en.wikipedia.org/wiki/ISO_4217)

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 01 Mar 2021

Did you know?

Socket

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