|
|
|
|
- Properties specific to NumericFormat variables
NumericFormat (Variable type) In french: FormatNumérique
The NumericFormat type allows you to define all the characteristics of the format to be used with the NumToString function. You can define and change the characteristics of this format using different WLanguage properties. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
f is NumericFormat
f.Notation = nfnDecimal
f.Sign = nfsAlways
f.DigitsAfterPoint = 4
f.MinimumLength = 8
f.ThousandSeparator = "'"
f.FillCharacter = " "
sResult is string = NumToString(1234.567, f)
Properties Properties specific to NumericFormat variables | | | Property name | Type used | Effect |
---|
Alignment | Integer constant | Number alignment. This property is also used to indicate on which side the fill characters will be added if necessary: - nfaRight (Default): Right-aligned, fill characters will be added on the left.
- nfaLeft: Left-aligned, fill characters will be added on the right.
| DecimalSeparator | Character string | Text to be used as decimal separator. By default, the decimal separator is the one defined for the current language ("Languages" tab in the project description window). Example: '3.14' with the "point" string used as decimal separator will be displayed as '3point14'. | DigitsAfterPoint | Integer | Number of digits after the decimal point. By default, there are 6 digits after the decimal point. Example: '3.14' with 4 digits after the decimal point will be displayed as '3.1400'. Remarks: - The number of decimal places must be less than 100.
- If the number has more decimal places than the value specified in the DigitsAfterPoint property, the decimal part will be truncated.
- If the number has less decimal places than the value specified in the DigitsAfterPoint property, the decimal part will be padded with zeroes ("0") on the right.
| ExponentialSign | Integer constant | Sign options for a number in exponential notation: - nfsMinusIfNegative: The sign will be displayed only if the number is negative.
- nfsAlways: The sign is always displayed.
| FillCharacter | Character | Characters to be used if the string is longer than the number to be displayed. Example: '3.14' in a string that is 6 characters long, using "x" as a fill character will be displayed as "3.14xx". | MinimumLength | Integer | Minimum string length. This property is associated with the Alignment property. The number of fill characters will correspond to the minimum total length minus the length of the number itself. If the number exceeds the minimum length, the MinimumLength property will be ignored. Remark: The total length includes the following elements: sign, thousand separator, decimal point, exponent, integer and decimal parts of the number. This length must be less than 100. | Notation | Integer constant | Type of notation to be used. Standard (decimal, i.e. `12.34`), or other (binary, hexadecimal, octal, exponential).- nfnBinary: Binary notation.
- nfnDecimal (Default): Decimal notation.
- nfnExponential: Exponential notation.
- nfnHexadecimal: Hexadecimal notation.
- nfnOctal: Octal notation.
| Prefix | Character string | Text to be used as prefix for the number, when displayed as a string. Example: '3.14' with the 'abc' prefix will be displayed as 'abc3.14'. | Sign | Integer constant | Sign display options: - nfsMinusIfNegative (Default): The '-' sign will be displayed only if the number is negative.
- nfsParenthesesIfNegative: If the number is negative, it will be enclosed in parentheses.
- nfsAlways: The sign is always displayed,
| ThousandSeparator | Character | Character to be used to split series of three zeros. By default, the thousand separator is disabled. Example: 10000 with the 'Z' character as a thousand separator will be displayed as '10Z000'. | Uppercase | Boolean | - True to use uppercase characters in a number format that contains letters (e.g.: 0xAB24DA),
- False to use lowercase characters.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|