Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Latest commit

 

History

History
24 lines (16 loc) · 584 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 584 Bytes

jquery.formatNumber

jQuery plugin for formatting numbers, good for currencies. Option to choose the cents and thousands digit. Defaults to US' 9,999.00.

Usage: $('.number').formatNumber();

This will make <span class="number">2932389423</span> for e.g., be formatted into <span class="number">29,323,894.23</span>.

##Options

//produces 29,323,894.23 (e.g. US standard)
$('.number').formatNumber({
  cents: '.',
  decimal: ','
});

//produces 29.323.894,23 (e.g. Brazil standard)
$('.number').formatNumber({
  cents: ',',
  decimal: '.'
});