Skip to content

jsCurrencyFormat, es un plugin que pasándole el 'locale' de un idioma te devuelve el numero contenido en el objeto formateado al tipo de moneda de ese país.

Notifications You must be signed in to change notification settings

xmontero/jsCurrencyFormat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsCurrencyFormat

Ir a la versión española

jsCurrencyFormat is a plugin that converts content in HTML objects to it's currency format using the locale, and a Boolean to indicate if you wants to show currency or not.

Default values are: lang = 'es' and showCurrency = false

Right now the plugin supports formats to this country codes:

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

The codes for countries will be based on the ISO 3166-1

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

Code example to format a number for spanish currency without the Euro symbol:

<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 the two parameters to the plugin:

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

jsCurrencyFormatter is a jQuery plugin, make sure you have the jquery library too.

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

About

jsCurrencyFormat, es un plugin que pasándole el 'locale' de un idioma te devuelve el numero contenido en el objeto formateado al tipo de moneda de ese país.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%