Started by
Danil2000707
on
Topic category: Help with Minecraft modding (Java Edition)
Faced with the problem of variables. Here I have a variable and at a certain action it increases by 0.1. This procedure is repeated several times and the variable becomes 0.300000004. Is there any way to fix this? To always have the correct number
This is due to Java rounding. If you want exact numbers, use integers (1, 2, 3, -4, ...) and avoid any decimal numbers and operations.
Okay I get it
Are there any procedures to round numbers to 0.1 or 0.2?