Limit digit to positive integer when formatting float in domain parser
Closes #14557
This commit is contained in:
1 parent
7c630a29a2
commit
204c5f826d
2 files changed
+3
-2
No files matched your search
@@ -2232,6 +2232,7 @@
|
||||
}
|
||||
var factor = Number(field.factor || 1);
|
||||
digit -= Math.round(Math.log10(factor));
|
||||
digit = Math.max(digit, 0);
|
||||
return (value * factor).toLocaleString(
|
||||
Sao.i18n.BC47(Sao.i18n.getlang()), {
|
||||
useGrouping: true,
|
||||
|
||||
@@ -354,8 +354,8 @@ def format_value(field, value, target=None, context=None, _quote_empty=False):
|
||||
cast = float
|
||||
factor = cast(field.get('factor', 1))
|
||||
digit -= round(math.log10(factor))
|
||||
return locale.localize(
|
||||
'{0:.{1}f}'.format(value * factor or 0, digit), True)
|
||||
digit = max(digit, 0)
|
||||
return locale.localize('{0:.{1}f}'.format(value * factor, digit), True)
|
||||
|
||||
def format_selection():
|
||||
if isinstance(field['selection'], (tuple, list)):
|
||||
|
||||
Reference in new issue
Block a user