round the number in number format
This commit is contained in:
parent
2c5ceffd2c
commit
e7d4d461eb
1 changed files with 4 additions and 4 deletions
|
|
@ -17,13 +17,13 @@ window.format_number = function(v, format, decimals){
|
|||
}
|
||||
info = get_number_format_info(format);
|
||||
|
||||
v = flt(v, null, format);
|
||||
//Fix the decimal first, toFixed will auto fill trailing zero.
|
||||
decimals = decimals || info.precision;
|
||||
|
||||
v = flt(v, decimals, format);
|
||||
|
||||
if(v<0) var is_negative = true;
|
||||
v = Math.abs(v);
|
||||
|
||||
//Fix the decimal first, toFixed will auto fill trailing zero.
|
||||
decimals = decimals || info.precision;
|
||||
|
||||
v = v.toFixed(decimals);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue