dinero.js

Create, calculate, and format money in JavaScript and TypeScript

dinero.js downloads dinero.js version dinero.js license

dinero.js类似的npm包:

npm下载趋势

3 年
🌟 在 dinero.js 的 README.md 中显示实时使用量图表,只需复制下面的代码。
## Usage Trend
[![Usage Trend of dinero.js](https://npm-compare.com/img/npm-trend/THREE_YEARS/dinero.js.png)](https://npm-compare.com/dinero.js#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 在 dinero.js 的 README.md 中显示 GitHub stars 趋势图表,只需复制下面的代码。
## GitHub Stars Trend
[![GitHub Stars Trend of dinero.js](https://npm-compare.com/img/github-trend/dinero.js.png)](https://npm-compare.com/dinero.js)

统计详情

npm包名称
下载量
Stars
大小
Issues
发布时间
License
dinero.js06,793858 kB246 个月前MIT

dinero.js的README

dinero.js

Create, calculate, and format money in JavaScript and TypeScript

This package exports Dinero.js. It works out of the box with number types, but you can adapt it for custom types or third-party libraries by implementing a custom calculator.

📦 Install

npm install dinero.js

# or

yarn add dinero.js

⚡️ Quick start

Dinero objects are minimal. Every function in dinero.js is side-effect free, allowing you only to bundle exactly what you use.

import { dinero, add } from 'dinero.js';
import { USD } from 'dinero.js/currencies';

const d1 = dinero({ amount: 500, currency: USD });
const d2 = dinero({ amount: 800, currency: USD });

add(d1, d2);

📚 Documentation

For full documentation, visit the online documentation.