|
|
|
|
|
- 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. Note: 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 = " "
sRésultat is string = NumériqueVersChaîne(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: - fncRight (Default): Right alignment, fill characters will be added on the left.
- fncLeft: Left-hand alignment, fill characters will be added on the right..
| Decimal separator | 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: - fnsMoinsiNégatif: The sign is displayed only if the number is negative..
- fnsAlways: 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. Note: The total length corresponds to the following elements: sign, thousands 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).- fnnBinary: Binary notation.
- fnnDecimal (Default): Decimal notation.
- fnnExponential: Exponential notation.
- fnnHexadecimal: Hexadecimal notation.
- fnnOctal: Octal notation.
| Prefix | Character string | Text to be used as prefix for the number, when displayed as a string. This property can correspond to: - a custom string.
Example: '3.14' with the 'abc' prefix will be displayed as 'abc3.14'. - the nfpAuto constant, to define an automatic prefix. In this case:
- decimal or exponential format: no prefix.
- binary format: 0b
- hexadecimal format: 0x
- octal format: 0o
| Sign | Integer constant | Sign display options: - fnsMinusNegative (Default): The '-' sign is displayed only if the number is negative.
- fnsParenthèsesSiNégatif: If the number is negative, it is surrounded by parentheses..
- fnsAlways: 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 capital letters when displaying a number in a format using letters (for example: 0xAB24DA),
- False to use lowercase characters.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|