🚀 DAY 3 OF LAUNCH WEEK:Announcing Bun and vlt Support in Socket.Learn more →
Socket
Book a DemoInstallSign in
Socket

@heathmont/money

Package Overview
Dependencies
Maintainers
139
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heathmont/money

```bash npm install --save "@heathmont/money" ```

latest
Source
npmnpm
Version
2.4.22
Version published
Maintainers
139
Created
Source

Usage

npm install --save "@heathmont/money"
import { toInteger, fromInteger, convertUnit } from "@heathmont/money";

toInteger(amount, currency, [unit])

toInteger(111111.222333443, 'BTC')
11111122233344

toInteger(111111222.333443, 'BTC', 'mBTC')
11111122233344

toInteger(111111.223332, 'EUR')
11111122333

toInteger(11111122.3332, 'EUR', 'cent')
11111122333

fromInteger(amount, currency, [unit])

fromInteger(11111122233344, 'BTC')
111111.22233344

fromInteger(11111122233344, 'BTC', 'uBTC')
111111222333.44

fromInteger(11111122333, 'EUR')
111111.22333

fromInteger(11111122333, 'EUR', 'cent')
11111122.333

convertUnit(amount, currency, fromUnit, toUnit)

convertUnit(111111222.333443, 'BTC', 'mBTC', 'uBTC')
111111222333.44

convertUnit(111111.223332, 'EUR', 'EUR', 'cent')
11111122.333

FAQs

Package last updated on 04 Oct 2024

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