Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daliborgogic/dlbr

Format currency with JavaScript Intl API
https://github.com/daliborgogic/dlbr

currency format nodejs string

Last synced: 9 days ago
JSON representation

Format currency with JavaScript Intl API

Awesome Lists containing this project

README

        

# Format currency

> To use JavaScript Intl API, Node.js needs to run with ```--icu-data-dir=node_modules/full-icu``` option that provides us to have Intl API in our Node environment

## Build Setup

``` bash
# install dependencies
$ npm i

# development
$ npm run dev

# test
$ npm t
```

## Example

```bash
# USD dollar
$ formatCurrency('en-US', 99.99)
> $99.99
# RSD dinar
$ formatCurrency('sr-RS', 99.99)
> 99.99 RSD
```