From 0568795eddb49e5bfb45c5a205da0d3ebd23c379 Mon Sep 17 00:00:00 2001 From: David Arnold Date: Sun, 17 Sep 2023 14:39:39 +0200 Subject: [PATCH] Revert "fix: make flt value idempotent" This reverts commit 4d0b0d35efa64a1692e075b71ae70c4969b81cda. --- frappe/public/js/frappe/utils/number_format.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/frappe/public/js/frappe/utils/number_format.js b/frappe/public/js/frappe/utils/number_format.js index 649353f654..9352733186 100644 --- a/frappe/public/js/frappe/utils/number_format.js +++ b/frappe/public/js/frappe/utils/number_format.js @@ -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; }