@vinuu123 Use HTL Number format [1], documentation says:
The formatting pattern supports both a positive and negative pattern, separated by semicolon. Each sub-pattern can have a prefix, a numeric part and a suffix. The negative sub-pattern can only change the prefix or/and suffix. The following characters are supported, at minimum:
0 - digit, shows as 0 if absent
# - digit, does not show if absent
. - decimal separator
- - minus sign
, - grouping separator
E - separator between mantissa and exponent
; - sub-pattern boundary
% - multiply by 100 and show as percentage
Characters can be escaped in prefix or suffix using single quotes. Single quotes are escaped as two in a row.
Examples:
${'#,###.00' @ format=1000}
${'#.###;-#.###' @ format=obj.number}
${'#.00;(#.00)' @ format=obj.number}
${'#.000E00' @ format=obj.number}
${'#%' @ format=obj.number}
${ 'curr #,###.##' @ format=1000.14, locale='de_CH', i18n}
will generate the following output if obj.number evaluates to -3.14:
1,000.00
-3.14
(3.14)
-.314E01
-314%
CHF 1'000.14 <!--/* assuming the formatter 'curr #,###.##' will be translated to 'CHF #,###.##' for the 'de_CH' locale by i18n */-->
[1] https://github.com/adobe/htl-spec/blob/1.4/SPECIFICATION.md