Skip to content

Commit

Permalink
fix: dont add trailing decimal separator (#25389) (#25391)
Browse files Browse the repository at this point in the history
(cherry picked from commit ddaf1d2)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Mar 13, 2024
1 parent 32c46c1 commit 760d9b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frappe/public/js/frappe/utils/number_format.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ function convert_old_to_new_number_format(v, old_number_format, new_number_forma
let old_group_regex = new RegExp(old_info.group_sep === "." ? "\\." : old_info.group_sep, "g");
v_before_decimal = v_before_decimal.replace(old_group_regex, new_info.group_sep);

v = v_before_decimal + new_info.decimal_str + v_after_decimal;
v = v_before_decimal;
if (v_after_decimal) {
v = v + new_info.decimal_str + v_after_decimal;
}

return v;
}

Expand Down

0 comments on commit 760d9b2

Please sign in to comment.