❔ Maximum value in a text box

Trying to get a text box to have a max value of 2147483647/int32 limit. It works fine for setting things to 0 if they're below it but above 2147483647 isn't working, the message box won't show either
8 Replies
Haze.
Haze.2y ago
Please read what you just typed again, you're trying to set an int to higher than the max int value?
Papa Quill -
Papa Quill -OP2y ago
Hm?
Papa Quill -
Papa Quill -OP2y ago
It's 4 bytes I want to make it so if the value in the text box is above 2,147,483,647 then it sets the text to 2,147,483,647
Haze.
Haze.2y ago
But value can never be greater than 2147484647?
mtreit
mtreit2y ago
You're going to need to parse it into a long (64 bit int)...clearly you can't have an int value greater than the maximum int value...that's a contradiction
Papa Quill -
Papa Quill -OP2y ago
Right, sorry I had a brain malfunction. Thanks
mtreit
mtreit2y ago
If it's guaranteed to never be negative you might also be able to use unsigned int instead of long Depending on your actual needs.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server