Round()

Syntax

Result.f = Round(Number.f, Mode)
Description
Round the specified float number according to the given mode. 'Mode' can be one of the following values:
  #PB_Round_Down   : rounds down the number
  #PB_Round_Up     : rounds up the number
  #PB_Round_Nearest: rounds to the nearest integer number (0.5 and up will round up)
Example:
  Debug Round(11.6, #PB_Round_Down)    ; Will print '11'
  Debug Round(-3.6, #PB_Round_Down)    ; Will print '-4'

  Debug Round(11.6, #PB_Round_Up)      ; Will print '12'
  Debug Round(-1.6, #PB_Round_Up)      ; Will print '-1'

  Debug Round(11.6, #PB_Round_Nearest) ; Will print '12'
  Debug Round(11.4, #PB_Round_Nearest) ; Will print '11'
  Debug Round(11.5, #PB_Round_Nearest) ; Will print '12'
  Debug Round(-7.5, #PB_Round_Nearest) ; Will print '-8'

Supported OS

All

<- Radian() - Math Index - Sign() ->