parse-float-from-br-currency
v1.0.0
Published
A simple function that turns a string like "R$ 10,95" into a valid float number 10.95.
Downloads
2
Maintainers
Readme
Parse Float From Brazilian Currency
This is a simple function to transform a string like this:
R$ 2.839.039,38
To a float number like this:
2839039.38
Or maybe (in the future) like this:
2,839,039.38
Setup
Node or Browserify
var parseFloatFromBrCurrecy = require('parse-float-from-br-currecy');
Browser (Global)
<script src="parse-float-from-br-currecy.js"></script>
Usage
var price = 'R$ 2.839.039,38';
console.log(parseFloatFromBrCurrecy(price)); // Will return: 2839039.38
console.log(typeof parseFloatFromBrCurrecy(price)); // Will return: "number"
License
MIT