Fixed number format

This commit is contained in:
Anand Doshi 2014-07-04 16:40:24 +05:30
parent 709734d3ac
commit 0971c5847a
2 changed files with 2 additions and 2 deletions

View file

@ -115,7 +115,7 @@ window.format_number = function(v, format, decimals){
}
// join decimal
part[1] = part[1] ? (info.decimal_str + part[1]) : "";
part[1] = (part[1] && info.decimal_str) ? (info.decimal_str + part[1]) : "";
// join
return (is_negative ? "-" : "") + part[0] + part[1];

View file

@ -382,7 +382,7 @@ def fmt_money(amount, precision=None, currency=None):
parts.reverse()
amount = comma_str.join(parts) + (precision and (decimal_str + decimals) or "")
amount = comma_str.join(parts) + ((precision and decimal_str) and (decimal_str + decimals) or "")
amount = minus + amount
if currency: