WoW:API ceil: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{wowapi}}
{{luaapi}}
{{:Lua/Libshortcut|ceil|math.ceil}}
 
ceil(value) returns the ceiling of the value (the next highest whole number) i.e. rounds value ''up''
ceil(value) returns the ceiling of the value (the next highest whole number) i.e. rounds value ''up''
int = math.ceil(n);
int = ceil(n);


== Examples ==
   > print(ceil(3.141592653))
   > print(ceil(3.141592653))
   4
   4
Line 9: Line 10:
   round
   round
   > print(ceil(n - .5))
   > print(ceil(n - .5))
{{LUA}}

Revision as of 22:52, 25 March 2010

WoW Lua

ceil(value) returns the ceiling of the value (the next highest whole number) i.e. rounds value up

int = math.ceil(n);
int = ceil(n);

Examples

 > print(ceil(3.141592653))
 4
 round
 > print(ceil(n - .5))