Contents
Display Legacy Contents

 Print
    Mask Number      
This Function returns a <string>, composed by the Value formated according to the remaining parameters.

Parameters

Value <numeric>
  Number to format.
   
Sign <numeric>
  Display the sign at left of the Value.

  Minus     Display only if it's a negative Value.
  Always

Always display the sign.
  Never

Never display the sign.
   
Add Thousand Separator <boolean>
  Display the Value with the thousand separator?
   
Thousand Separator <string>
  Char to represent the thousand separator.
   
Round <boolean>
  Round the value?
   
Decimal Places <numeric>
  Number of decimal places to round if the Round parameter is true.
Number of decimal places to add zeros to the right if Add Right Zeros parameter is true.
   
Decimal Separator <string>
  Char to represent the decimal separator.
   
Add Right Zeros <boolean>
  Use char "0" to complete the Value at right in order to achieve the number of Decimal Places to display.

     
Example 1   Example 2
MaskNumber("-10000", MINUS, TRUE, ".", FALSE, 0, "", FALSE)

Result = -10.000
  MaskNumber("-10000", ALWAYS, TRUE, ".", FALSE, 0, "", FALSE)

Result = -10.000
     
Example 3   Example 4
MaskNumber("-10000", NEVER, TRUE, ".", FALSE, 0, "", FALSE)

Result = 10.000
  MaskNumber("10000", ALWAYS, TRUE, ".", FALSE, 0, "", FALSE)

Result = +10.000
     
Example 5   Example 6
MaskNumber("10000.5", MINUS, TRUE, ".", TRUE, 1, ",", FALSE)

Result = 10.000,6
  MaskNumber("10000.55", MINUS, TRUE, ".", TRUE, 3, ",", FALSE)

Result = 10.000,55
Example 7 Example 8
MaskNumber("10000.55", MINUS, TRUE, ".", TRUE, 3, ",", TRUE)

Result = 10.000,550
MaskNumber("10000.55", MINUS, TRUE, ".", FALSE, 1, ",", TRUE)

Result = 10.000,55


     
  • If Round is false, Add Right Zeros is true, and the decimal places in the Value are more than Decimal Places parameter, the decimal part will remain unmodifyed (see Example 8).

See also
Samples

 
Updated: 11/5/2014 11:50 AM