Help / WLanguage / WLanguage functions / Standard functions / Numeric values functions / Math functions
  • Decimal separator
  • Precision of the reals
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Abs (Function)
In french: Abs
Returns the absolute value:
  • of a numeric value,
  • of a numeric expression (integer or real).
  • of a duration.
    WEBDEV - Browser codePHP Not available.
// Retrieve the absolute value
ResAbsoluteValue = Abs(-16.23) // Returns 16.23
ResAbsoluteValue = Abs(4.51 + 16.23) // Returns 20.74
// Retrieve the absolute value
ResAbsoluteValue is Duration = Abs(5 min) // Returns 0000500000
ResAbsoluteValue = Abs(-15 min) // Returns 0001500000
<Result> = Abs(<Handled value>)
<Result>: Integer, real or duration
Sought absolute value.
<Handled value>: Numeric expression, integer, real or duration
Value to handle:
  • Numeric expression,
  • Numeric value,
  • Duration:
    • Duration variable containing the duration in "+DHHMMSSCCC" format (D corresponds to the number of days, HH to hours, MM to minutes, SS to seconds and CCC to milliseconds).
    • Duration in a readable format (e.g., 1 d 2 h 3 min 10 s 10 ms).
    WEBDEV - Browser codePHP Not available.

Decimal separator

The decimal separator for the real numbers is the one defined in the control panel of Windows.
Reports and QueriesWindowsLinuxUniversal Windows 10 AppJavaUser code (UMC)PHPAjaxStored procedures

Precision of the reals

If the parameter passed to the function is a real, the result is always an 8-byte real.
If the parameter passed to the function is a 4-byte real, the result will be considered as being an 8-byte real, which may result in additional decimal places when displaying the number. For example:
rValue is 4-byte real = -1.70
Trace(Abs(rValue)) // Displays 1.700000047684
To avoid this type of problem, we advise you to use reals (without specifying the size) or currencies.
Business / UI classification: Neutral code
Component: wd290mat.dll
See also
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment

Last update: 05/05/2023

Send a report | Local help