2017 © Pedro PelĆ”ez
 

library jscurrencyformat

jQuery plugin to format numbers to currency

image

marinaplanells/jscurrencyformat

jQuery plugin to format numbers to currency

  • Sunday, March 23, 2014
  • by MarinaPlanells
  • Repository
  • 0 Watchers
  • 1 Stars
  • 1,244 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

jsCurrencyFormat

jsCurrencyFormat is a plugin that converts content in HTML objects to it's currency format using the locale, a Boolean to indicate if you wants to show currency or not and an Int for de number of decimals to show, (*1)

Right now the plugin supports formats to this country codes:, (*2)

  • es
  • uk
  • fr
  • de
  • it
  • ie
  • be
  • lu
  • nl
  • gr
  • de
  • us

The codes for countries will be based on the ISO 3166-1, (*3)

It will be more country currency formats supported ASAP. You can see the open Issue's to know what countries will come next., (*4)

Code example to format a number for spanish currency without the Euro symbol:, (*5)

<p><span class="num">256984.25</span></p>
<p><input class="num" value="256984.25"/></p>
    $(document).ready(function(){
        $('.num').currencyFormatter();
    });

But if we want to format the same HTML code to french format with the Euro symbol, we only have to pass this two parameters to the plugin:, (*6)

    $(document).ready(function(){
        $('.num').currencyFormatter({
                lang: 'fr',
                showCurrency: true
            });
    });

Right now the plugin accept this parameters:, (*7)

Parameter values default value
lang ISO 3166-1 es
showCurrency Boolean false
decimalsNumber Int 2

jsCurrencyFormatter is a jQuery plugin, make sure you have the jquery library too., (*8)

<script type="text/javascript" src="./js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./js/currencyFormatter.min.js"></script>

The Versions

23/03 2014

dev-master

9999999-dev https://github.com/MarinaPlanells/jsCurrencyFormat

jQuery plugin to format numbers to currency

  Sources   Download

The Requires

 

currency format