#Help Pls lol
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Help guys plsss
what is your issue?
btw, your issue is probably that "5/100" is 0
because this is integer division
do "dis" is always going to be 0
You are using integer division
It all rounds down to 0
If you want to round down I'm the normal way, you can do price * 5 / 100 instead of the other way round
Or you can also use doubles
Using 5.0 or 5D
Instead of 5
won't this'll also fail if price is 1?
If they are casting to int afterwards, it would ane way be 0
I said if they want to round it down after the calculation they can do that
Np, we all make silly errors
@dull cove In addition to the bug you noticed and that the previous messages described, the numbers on the borders won't do what you want them to do.
If price is exactly 2000, it will be neither < 2000 nor > 2001, so neither the first nor the second conditional blocks get triggered.
You have to use <= and >= if you want the numbers at the borders to be included in the if blocks.
I think so 5.0 will work
As a matter of fact, the first condition in the else ifs can be entirely removed as they are handled by the previous if
Works with price*dis/100