Fix wrong precision shown in form (#3400)
This commit is contained in:
parent
9503ae655b
commit
4f80f7633f
2 changed files with 4 additions and 2 deletions
|
|
@ -54,7 +54,7 @@ frappe.form.formatters = {
|
|||
var currency = frappe.meta.get_field_currency(docfield, doc);
|
||||
var precision = docfield.precision || cint(frappe.boot.sysdefaults.currency_precision) || 2;
|
||||
return frappe.form.formatters._right((value==null || value==="")
|
||||
? "" : format_currency(value, currency, docfield.precision), options);
|
||||
? "" : format_currency(value, currency, precision), options);
|
||||
},
|
||||
Check: function(value) {
|
||||
if(value) {
|
||||
|
|
|
|||
|
|
@ -127,7 +127,9 @@ window.format_number = function(v, format, decimals){
|
|||
function format_currency(v, currency, decimals) {
|
||||
var format = get_number_format(currency);
|
||||
var symbol = get_currency_symbol(currency);
|
||||
var decimals = frappe.boot.sysdefaults.currency_precision || null;
|
||||
if(decimals === undefined) {
|
||||
decimals = frappe.boot.sysdefaults.currency_precision || null;
|
||||
}
|
||||
|
||||
if(symbol)
|
||||
return symbol + " " + format_number(v, format, decimals);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue