Fallen_Stress Posted November 27, 2020 Posted November 27, 2020 Hi guys I need your help for someone important. How can i compare any integer number to a negative number. i am using a prompts input i dont want the user to input a negative number so i want to bock all negative numbers. if Currencies[1] < 0 then gg.alert(" Negative number are not allowed. Please try again with a positive numbers") Currencies() return end end
MonkeySAN Posted November 27, 2020 Posted November 27, 2020 try if this work... if tonumber(Currencies[1]) < 0 then gg.alert(" Negative number are not allowed. Please try again with a positive numbers") Currencies() return end end
MonkeySAN Posted November 27, 2020 Posted November 27, 2020 for comparing number im guess... in this case..your input Currencies[1] to 0..if less than 0 (< 0) then script return but im no expert.
Question
Fallen_Stress
Hi guys I need your help for someone important.
How can i compare any integer number to a negative number.
i am using a prompts input i dont want the user to input a negative number so i want to bock all negative numbers.
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.