|
@@ -69,11 +69,11 @@ frappe.form.formatters = { |
|
|
var decimals = parts.length > 1 ? parts[1] : ""; // parts.length == 2 ??? |
|
|
var decimals = parts.length > 1 ? parts[1] : ""; // parts.length == 2 ??? |
|
|
|
|
|
|
|
|
if ( decimals.length < 3 || decimals.length < precision ) { |
|
|
if ( decimals.length < 3 || decimals.length < precision ) { |
|
|
const fraction = frappe.model.get_value(":Currency", currency, "smallest_currency_fraction_value") || 100; // if not set, minimum 2. |
|
|
|
|
|
let fraction_parts = cstr(fraction).split("."); |
|
|
|
|
|
|
|
|
const fraction = frappe.model.get_value(":Currency", currency, "fraction_units") || 100; // if not set, minimum 2. |
|
|
|
|
|
precision = cstr(fraction).length - 1; |
|
|
|
|
|
|
|
|
if (fraction_parts.length > 1) { |
|
|
|
|
|
precision = fraction_parts[1].length; |
|
|
|
|
|
|
|
|
if (decimals.length < cstr(fraction).length) { |
|
|
|
|
|
precision = cstr(fraction).length - 1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|