Rounding down on Lua
Hey guys, quick question...
I've created a button which allows me to increase/decrease the height of ChatFrame by using OnMouseWheel. The button also shows the height of the ChatFrame with OnSizeChanged: Lua Code:
While I appreciate it's accuracy lol, could someone give me a pointer on how I can round down the data that I get from GetHeight()? Any help would be hugely appreciated :). Aanson |
Lua Code:
http://wowprogramming.com/docs/api_categories#lua :) On an unrelated note, all of the numbers behind the separator you're seeing are not due to accuracy, but due to the inaccuracy of how numbers are stored on a computer - at least non-integer numbers, but in lua, integers and non-integers are treated in the same way. |
Cheers!
Cheers mate that's great :)
|
I would suggest doing floor(ChatFrame1:GetHeight() + 0.5), so that if it returns 179.99999943743243 you will end up with 180, which is probably what you want.
|
Quote:
Aanson |
All times are GMT -6. The time now is 04:53 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI