Revert "fix: make flt value idempotent"
This reverts commit 4d0b0d35ef.
This commit is contained in:
parent
9f0c8be183
commit
0568795edd
1 changed files with 1 additions and 7 deletions
|
|
@ -8,12 +8,7 @@ if (!window.frappe) window.frappe = {};
|
|||
function flt(v, decimals, number_format, rounding_method) {
|
||||
if (v == null || v == "") return 0;
|
||||
|
||||
if (!(typeof v === "number" || String(parseFloat(v)) == v)) {
|
||||
// cases in which this block should not run
|
||||
// 1. 'v' is already a number
|
||||
// 2. v is already parsed but in string form
|
||||
// if (typeof v !== "number") {
|
||||
|
||||
if (typeof v !== "number") {
|
||||
v = v + "";
|
||||
|
||||
// strip currency symbol if exists
|
||||
|
|
@ -29,7 +24,6 @@ function flt(v, decimals, number_format, rounding_method) {
|
|||
if (isNaN(v)) v = 0;
|
||||
}
|
||||
|
||||
v = parseFloat(v);
|
||||
if (decimals != null) return _round(v, decimals, rounding_method);
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue