JSPM

parse-float-from-br-currency

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q22265F
    • License MIT

    A simple function that turns a string like "R$ 10,95" into a valid float number 10.95.

    Package Exports

    • parse-float-from-br-currency

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-float-from-br-currency) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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