Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do you convert a number to positive?

Asked by
sonuka 24
5 years ago

How do you convert a negative number to positive?

1 answer

Log in to vote
2
Answered by 5 years ago

Use absolute value:

local num = -5

print(math.abs(num)) -->5
Ad

Answer this question