round

func round(n : Number) -> Integer
  return floor(n+0.5)

Returns the integer closest to the given number. For example:
  round(1.9) = 2
  round(1.49999) = 1
  round(-1.9) = -2
  round(-1.5) = -1
See also: abs, ceil, floor, frac, int, sign

Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.