Skip to content

Commit

Permalink
Merge pull request customd#77 from Invader444/master
Browse files Browse the repository at this point in the history
Default dec_point and thousands_sep use locale.
  • Loading branch information
samatcd committed Apr 28, 2015
2 parents 3e99217 + d7f2544 commit 6331154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.number.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@
*/
$.number = function( number, decimals, dec_point, thousands_sep ){
// Set the default values here, instead so we can use them in the replace below.
thousands_sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep;
dec_point = (typeof dec_point === 'undefined') ? '.' : dec_point;
thousands_sep = (typeof thousands_sep === 'undefined') ? new Number(1000).toLocaleString().charAt(1) : thousands_sep;
dec_point = (typeof dec_point === 'undefined') ? new Number(0.1).toLocaleString().charAt(1) : dec_point;
decimals = !isFinite(+decimals) ? 0 : Math.abs(decimals);

// Work out the unicode representation for the decimal place and thousand sep.
Expand Down

0 comments on commit 6331154

Please sign in to comment.