angerangel edited this page Jan 7, 2013 · 1 revision

USAGE

   ROUND value /to scale /even /down /half-down /floor /ceiling /half-ceiling

DESCRIPTION

Rounds a numeric value; halves round up (away from zero) by default.

ROUND is an action value.

ARGUMENTS

  • value -- The value to round (number! pair! money! time!)

REFINEMENTS

  • /to -- Return the nearest multiple of the scale parameter
    • scale -- Must be a non-zero value (number! money! time!)
  • /even -- Halves round toward even results
  • /down -- Round toward zero, ignoring discarded digits. (truncate)
  • /half-down -- Halves round toward zero
  • /floor -- Round in negative direction
  • /ceiling -- Round in positive direction
  • /half-ceiling -- Halves round in positive direction

#SOURCE

round: make action! [  [
    {Rounds a numeric value; halves round up (away from zero) by default.}
    value [number! pair! money! time!] "The value to round"
    /to "Return the nearest multiple of the scale parameter"
    scale [number! money! time!] "Must be a non-zero value"
    /even "Halves round toward even results"
    /down {Round toward zero, ignoring discarded digits. (truncate)}
    /half-down "Halves round toward zero"
    /floor "Round in negative direction"
    /ceiling "Round in positive direction"
    /half-ceiling "Halves round in positive direction"
] ]
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.