Ok not sure if someone came into this problem but why does 0.1 + 0.1 + 0.1 = 0.30000000000000004 I’ve read articles about programming and seems like it’s an issue that occurs in most programming language
You could multiply the number by 10 so that it moves one digit to the left. Then, you can round it as an integer and divide by 10 to get your number rounded to the tenths.
if #DisciplineValues == 5 then
if DisciplineValues[1] / 10 >= 10 then
_10Divisor = math.floor(DisciplineValues[1] / 10)
print("DIVISOR 10 IS : " .. _10Divisor)
for i = 1, _10Divisor do
Multiplier += 0.1
local formattedString = string.format("%0.1f", Multiplier)
FormatedMultiplier = tonumber(formattedString)
print("MULTIPLIER VALUE IS : " .. FormatedMultiplier)
DEFAULT_REBIRTH_MAX += 10
end
end
end
print("MULTIPLIER VALUE IS : " .. FormatedMultiplier)
print("REBIRTH MAXIMUM VALUE IS : " .. DEFAULT_REBIRTH_MAX)