ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Properties specific to NumericFormat variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
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.
Example
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 nameType usedEffect
AlignmentInteger constantNumber 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 separatorCharacter stringText 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'.
DigitsAfterPointIntegerNumber 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.
ExponentialSignInteger constantSign 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.
FillCharacterCharacterCharacters 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".
MinimumLengthIntegerMinimum 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.
NotationInteger constantType 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.
PrefixCharacter stringText 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
SignInteger constantSign 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,
ThousandSeparatorCharacterCharacter 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'.
UppercaseBoolean
  • True to use capital letters when displaying a number in a format using letters (for example: 0xAB24DA),
  • False to use lowercase characters.
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/20/2024

Send a report | Local help