WoW:API abs: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Use Lua/Libshortcut template. Change category from "LUA Functions" to "Lua functions".)
m (Move page script moved page API abs to API abs without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{:Lua/Libshortcut|abs|math.abs}}
{{wowlua}}
<center>'''abs''' ''-Documentation by AlexanderYoshi-''</center>
 
Returns the absolue value of the number.
Returns the absolue value of the number.
absoluteValue = math.abs(num);
absoluteValue = abs(num);


abs(num);
== Arguments ==
 
;num
----
: Number - number to return numeric (absolute) value of.
;''Arguments''
 
:(Number num)
 
:;num : The number to convert
 
----
;''Returns''
 
:Number absoluteValue
 
:;absoluteValue : The absolute value of the inputed number num
 
----
;''Example''
local absoluteValue = abs(-14);
 
;''Result''
absoluteValue := 14
 
----
;''Description''
 
: Returns the absolue value of the number.


== Returns ==
;absoluteValue
: Number - The absolute value of the argument number.


{{LUA}}
== Example ==
print(abs(-14)); -- 14

Latest revision as of 04:44, 15 August 2023

WoW Lua

Returns the absolue value of the number.

absoluteValue = math.abs(num);
absoluteValue = abs(num);

Arguments

num
Number - number to return numeric (absolute) value of.

Returns

absoluteValue
Number - The absolute value of the argument number.

Example

print(abs(-14)); -- 14