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
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
From version 28, RoundUp is kept for backward compatibility. This function has been replaced with RoundCeil.
Returns:
  • the numeric value rounded up to the nearest integer.
  • the duration rounded up to the nearest interval.
    WEBDEV - Server codePHP Not available.
  • the date and time rounded up to the nearest interval.
    WEBDEV - Server codePHP Not available.
Example
ResArrondi = RoundCeil(-16.238167, 2) // Renvoie -16.23
ResArrondi = RoundCeil(3.1) // Renvoie 4 (pas de décimales)
ResArrondi = RoundCeil(3.111, 2) // Renvoie 3.12
ResArrondi = RoundCeil(1.9) // Renvoie 2
ResArrondi = RoundCeil(-1.9) // Renvoie -1
// Arrondi d'une Durée
ResArrondiDurée is Duration
ResArrondiDurée = RoundCeil(13 min, 5 min) // Renvoie 15 min (0001500000)
// La durée est découpée en périodes de 5 minutes. 
// Le résultat correspond à la fin de la période qui contient la durée 13 min.
// Arrondi d'une DateHeure
dhMonDateHeure is DateTime = "202211041524"
Trace("dhMonDateHeure: " + dhMonDateHeure)
Trace("ArrondiSupérieur: " + RoundCeil(dhMonDateHeure, 7 min)) 
// Affiche 20221104153100000

// La journée est découpée en périodes de 7 min.
Syntax

Rounding a numeric value up Hide the details

<Result> = RoundCeil(<Numeric value> [, <Number of decimals>])
<Result>: Integer or real
Value rounded to the greater number.
<Numeric value>: Real or currency
Numeric value to round.
<Number of decimals>: Optional integer
Number of decimals to return. If this parameter is not specified, no decimal is returned.
WEBDEV - Browser codePHP Not available

Rounding a duration up in a given interval Hide the details

<Result> = RoundCeil(<Duration used> , <Interval>)
<Result>: Duration
Duration corresponding to the end of the given interval.
<Duration used>: Duration
Duration to round:
  • 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).
<Interval>: Duration
Time period taken into account to round the duration up:
  • 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

Rounding a DateTime variable up in a given interval Hide the details

<Result> = RoundCeil(<DateTime handled> , <Interval>)
<Result>: DateTime
DateTime variable corresponding to the end of the given interval.
<DateTime handled>: DateTime
Date and time to be rounded.
<Interval>: Duration
Time period taken into account to round the duration up:
  • 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).
Remarks
The decimal separator for real numbers is "." (point).
Business / UI classification: Neutral code
Component: wd300mat.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help