ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV, WEBDEV and WINDEV Mobile 2024 feature!
Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Properties specific to NumericFormat variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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.
Remark: 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 = " "
sResult is string = NumToString(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:
  • nfaRight (Default): Right-aligned, fill characters will be added on the left.
  • nfaLeft: Left-aligned, fill characters will be added on the right.
DecimalSeparatorCharacter 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:
  • nfsMinusIfNegative: The sign will be displayed only if the number is negative.
  • nfsAlways: 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.
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.
NotationInteger constantType 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.
PrefixCharacter stringText 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'.
SignInteger constantSign 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,
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 uppercase characters in a number format that contains letters (e.g.: 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: 03/11/2024

Send a report | Local help