Nothing Particularly Magnificent

npm

Need private packages and team management tools?Check out npm Orgs. »

format-currency-to-br

1.0.0 • Public • Published

Format Float to Brazilian Currency

This is a plugin to transform a number like this:

123123.12

To a masked string like this:

R$ 1.231.23,12

Install

With npm:

npm install --save format-currency-to-br

With bower:

bower install --save format-currency-to-br

Or you can just download a ZIP.

Setup

Node or Browserify
var formatCurrencyToBr = require('format-currency.to-br');
Browser (Global)
<script src="format-currency.to-br.js"></script>

Usage

var price = 2839039.38;
 
console.log(formatCurrencytoBr(price)); // Will return: 'R$ 2.839.039,38'

License

MIT

install

npm i format-currency-to-br

Downloadsweekly downloads

264

version

1.0.0

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability