AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de valores numéricos / Funciones matemáticas
  • Numeric value
  • Decimal separator
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
Returns the rounded value of a numeric value according to the specified number of decimal places.
Example
// Retrieve the rounded value of -16.238167
ResRound = Round(-16.238167, 2)
// Returns -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. No decimal is returned if this parameter is not specified.
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 accurate. Indeed, the operations performed with the "real" types are not precise because of the computing representation of 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: wd290mat.dll
Versión mínima requerida
  • Versión 9
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 03/10/2023

Señalar un error o enviar una sugerencia | Ayuda local