ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Numeric values functions / Math functions
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
Warning
From version 28, RoundDown is kept for backward compatibility. This function has been replaced with RoundFloor.
Returns:
  • the numeric value rounded down to the nearest integer.
  • the duration rounded down to the nearest interval.
    WEBDEV - Server codePHP Not available.
  • the date and time rounded down to the nearest interval.
    WEBDEV - Server codePHP Not available.
Example
ResRound = RoundFloor(-16.238167,2) // Returns -16.24
ResRound = RoundFloor(3.9) // Returns 3 (no decimal)
ResRound = RoundFloor(3.999,2) // Returns 3.99
ResRound = RoundFloor(1.9) // Returns 1
ResRound = RoundFloor(-1.9) // Returns -2
// Rounded Duration
ResRoundedDuration is Duration
ResRoundedDuration = RoundFloor(13 min, 5 min) // Returns10 min (0001000000)
// The duration is divided into 5-minute periods.
// The result is the start of the time range that contains 13 min.
// Rounded DateTime variable
dtMyDateTime is DateTime = "202211041524"
Trace("dtMyDateTime: " + dtMyDateTime)
Trace("RoundFloor: " + RoundFloor(dtMyDateTime, 7 min)) 
// Displays 20221104152400000

// The day is divided into 7-minute periods.
// In this example, the dtMyDateTime variable is rounded down to the nearest value
Syntax

Rounding a numeric value down Hide the details

<Result> = RoundFloor(<Numeric value> [, <Number of decimals>])
<Result>: Integer or real
Value rounded to the lower 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 down in a given interval Hide the details

<Result> = RoundFloor(<Duration used> , <Interval>)
<Result>: Duration
Duration corresponding to the start 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 down:
  • 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 down in a given interval Hide the details

<Result> = RoundFloor(<DateTime handled> , <Interval>)
<Result>: DateTime
DateTime variable corresponding to the start of the given interval.
<DateTime handled>: DateTime
Date and time to be rounded.
<Interval>: Duration
Time period taken into account to round the duration down:
  • 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: wd290mat.dll
Minimum version required
  • Version 16
This page is also available for…
Comments
COMO USAR ROUNDDOWN
Nessa aula de hoje

COMO USAR ROUNDDOWN


EDT_RESULTADO=EDT_a*EDT_b
EDT_RESULTADO1=Round(EDT_a*EDT_b,2)

EDT_RESULTADO2=RoundDown(EDT_a*EDT_b,2)

EDT_resultado_texto="sem round ["+EDT_RESULTADO+CR
EDT_resultado_texto+="Round ["+EDT_RESULTADO1+CR
EDT_resultado_texto+="RoundDown ["+EDT_RESULTADO2+CR

// BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com.br/2017/07/aula-1196-comandos-17-rounddown.html

https://www.youtube.com/watch?v=NQHfyvnBRQk


De matos
04 Jul. 2017

Last update: 02/27/2024

Send a report | Local help