#Force output to be integer

6 messages · Page 1 of 1 (latest)

abstract sand
#

So, I have a recipe handler that's expecting an integer for one of it's options. Whenever I attempt to set a recipe with KubeJS, that option gets a float passed to it and nothing happens.

Is there any way to force 2 to resolve to 2 and not 2.0?

I've tried Math.floor(), Math.trunc(), parseInt(), and even converting to a string, but whenever I log out the result it is 2.0 (except the string, that gave me 2 but still didn't work for the recipe)

eternal lotusBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

cedar cloak
#

floor should return int O.o

#

im assuming Math.round() wont work either then

abstract sand
#

... yeah, looks like the issue was the wrong mod version all along. CF told me I had the latest but I had 2 versions prior in my mods folder. Just before the feature was added that I'm trying to use