sc_format_num({My_Field}, "Group_Symb", "Dec_Symb", "Amount_Dec", "Fill_Zeros", "Side_Neg", "Currency_Symb", "Side_Currency_Symb")

This macro is used to format numerical values.

 

Parameter
Description
My_Field Variable or field to format (The return is in the next variable).
Group_Symb Integer values grouping symbol.
Dec_Symb Decimals separator symbol.
Amount_Dec Number of decimals to be displayed.
Fill_Zeros Complete decimals with zeros (fill in) (S = yes and N = no).
Side_Neg Negative sign position. (1 = left and 2 = right)
Currency_Symb Monetary symbol to be displayed.
Side_Currency_Symb Currency symbol position. (1 = left and 2 = right).



Ex. 1: Formatting an integer.
sc_format_num({my_value}, '.', '', '0', 'N', '1', '');
Input value = 001234567890
Output value = 1.234.567.890

Ex. 2: Formatting a negative value and truncating decimals.
sc_format_num({my_value}, '.', '', '0', 'N', '1', '');
Input value = 0012345678.90-
Output value = -12.345.678

Ex. 3: Formatting a value with 4 decimals and filling with zeros.
sc_format_num({my_value}, '.', ',', '4', 'S', '1', '');
Input value = 0012345678.9
Output value = 12.345.678,9000

Ex. 4: Formatting a value with 2 decimals, filling with zeros and using monetary symbol.
sc_format_num({my_value}, '.', ',', '2', 'S', '1', 'US$');
Input value = 0012345678.9
Output value = US$ 12.345.678,90

Ex. 5: Formatting a value with 2 decimals, filling with zeros.
sc_format_num({my_value}, '.', ',', '2', 'S', '1', '');
Input value = .9
Output value = 0,90