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 / Numeric values functions / Math functions
  • Numeric value
  • Decimal separator
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the rounded value of a numeric value according to the specified number of decimal places.
Example
// Récupération de la valeur arrondie de -16.238167
ResArrondi = Round(-16.238167, 2)
// Renvoie -16.24
Syntax
<Result> = Round(<Numeric value> [, <Number of decimals>])
<Result>: Integer or real
Rounded value of the specified numeric value.
<Numeric value>: Real or currency
Numeric value to round. We recommend that you use the currency type in order to get reliable results.
<Number of decimals>: Optional integer
Number of decimals to return. If this parameter is not specified, no decimal is returned.
Remarks

Numeric value

If <Numeric value> is included between:
  • 0 and 0.49: the number is rounded to 0. For example, 3.2 is rounded to 3 (no decimal).
  • 0.5 and 0.99: the number is rounded to 1. For example, 3.7 is rounded to 4 (no decimal).
Caution: Rounding with the "Real" type is not precise.. In fact, operations with the "real" type are not precise due to the computer representation of the reals.. To get an exact rounding, we recommend that you use the Currency or Numeric type that uses an exact memory representation. For more details, see the real type.

Decimal separator

The decimal separator for real numbers is "." (point).
Component: wd300mat.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/18/2024

Send a report | Local help