How could i make it so i could have a number round up form a decimal
like experience
Thanx
ID:179497
![]() Dec 16 2001, 4:54 am
|
|
I got it to work but this is what i used
usr.expreq=round(usr.expreq+1) I dont know what you were gettin at but it was not needed this was the only thing needed and it worked |
What he was "getting at" is that in your game, if I kill a monster who gives 5 experience, I'll earn 6 experience for it! You call that rounding? I suggest you go back and read through Lummox's post again... if you don't understand some of the terms, do a little research on the subject and you'll probably learn something you can use all over the place.
|
To find the ceiling of a positive number, you'll have to be a little more creative. round(x) will give you a floor in this case, but if you want to always round up, you'll have to add 1. However, there's the special case where x==round(x), so you should try this:
If you insert that into a stat panel or something:
stat("Strength",(x==round(x))?(x):(round(x)+1))
Lummox JR