parse-float-from-br-currency

    1.0.0 • Public • Published

    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

    Install

    npm i parse-float-from-br-currency

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • brunoti