js802025 / calcmod

Calculator Mod
MIT License
13 stars 4 forks source link

Can't Use Mod to Divide #36

Closed cheddar98 closed 1 month ago

cheddar98 commented 2 months ago

I don't know if this is an actual issue or if I just couldn't figure it out, but trying to divide within an expression or creating an expression just results in "NaN".. Example: 1728/8=NaN

cheddar98 commented 2 months ago

As an additional note, when I tried to create custom functions with the divide function, it seemed to complete break the other functions. When I removed said custom functions, things worked normally. Two pictures attached, one before I removed the broken functions and one after. NaN After

shadeydo commented 2 months ago

strange. I can't replicate this on the latest calcmod version. do you have any other mods that might be causing the issue?

cheddar98 commented 1 month ago

I do have other mods in my main save, but I tried making a new save with no other mods but CalcMod, and it still seemed to happen. Version 1.3.2+fabric.1.21. Tried making a function that was just [num-blocks]/8 and it won't come out with an answer and also breaks other functions. After testing a bit, it seems to be not just the divide function, but making any custom function at all. Will turn up with NaN for itself and other functions. This picture is from a save with just Fabric API and CalcMod, no other mods: custom functions

shadeydo commented 1 month ago

after some testing it seems the issue lies in using a minus sign in the input of the function "[num-blocks]/8". removing the minus (like using [numBlocks]/8) should get things back to normal!

cheddar98 commented 1 month ago

That seemed to fix it, sort of. It doesn't break other functions now, but entering a number for the function will still give NaN, but if I enter something like sb or dub it seems to work. Maybe I'm entering it wrong? I am unsure. Thank you so much for your help.

The function I entered: ([numBlocks]/8)

2024-08-20_00 45 17

This picture again is with just Fabric API and CalcMod.

shadeydo commented 1 month ago

I think this issue is derived from the lack of parenthesis when calling your function. /calc fuel(1728) should work. sorry for all the confusion, I will work to make the description and help menus more clear in the future!

cheddar98 commented 1 month ago

That does in fact work. Thank you very much, I appreciate the help greatly. It was a little confusing but makes a lot more sense now, thank you.