Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

can you put a + in front of negavite number to make it positive?

Nothing more to say. Help needed!

2 comments

0

i mean like +negativevalue = 1 where negativevalue = -1

0

is it possible?

2 answers

✓ Accepted answer

Yes, yes you can. But instead of +, you use -. Negative negative = positive.

local negativeNumber = -5
print(negativeNumber) -- console: -5
print(-negativeNumber) -- console: 5

1 comment

1

additionally you can use math.abs if you are only expecting positive values.

A better way to answer this is math.abs. The function always returns a positive number, regardless of wether the input is positive or negative. If you know basic math, this is just an absolute value function.

This discussion is preserved as it was. New answers, comments, and votes are closed.