I can't seem to find or figure out where to post questions, specifically about LUA, for instance, what's the syntax for simple rounding, using the math function?
Printable View
I can't seem to find or figure out where to post questions, specifically about LUA, for instance, what's the syntax for simple rounding, using the math function?
See the developers guide https://fantasygroundsunity.atlassia...eveloper+Guide as a starting point. You’ll probably get more help by posting in the armoury section or on Discord.
math.ceil (round up) or math.floor (round down) on a number. Most questions would be placed in the Workshop when related to coding questions.
https://www.lua.org/docs.html for general questions about the LUA language. As mentioned above see the developer guide section of the FG wiki for information specific to programming for FG.
I find plenty of info on .ceil and .floor, but that's just round up, round down. I need a simple rounding, where .5 is rounded up and anything less is rounded down. Gone through the LUA 5.1 reference and so far, it's looking like I'll just have to make a function.
Can an admin move this to the Armory or Workshop, or do I just repost it?
Lua deliberately doesnt have existing functions for everything.
If you need to do something like simple rounding use
math.floor(num + 0.5);