player gets tools of seperated bank notes (correctly subtracts)
player deposits banknotes
money goes back into account and it goes to 4999.01 instead of the original value 5000, adds incorrectly.
Server script
local updateBy = tonumber(money.Name:match('%d+'))
if string.find(money.Name,'p') then updateBy /= 100 end
ReplicatedStorage.RemoteEvents.UpdateMoney:FireClient(plr,math.floor(updateBy * 100 + 0.5) / 100)
money is a tool that the player can have, its name can be something like $1 or $5 or 50p
What happens if you use math.round instead of your code of math.floor and +.5?
Any time you do a calculation like this it may not hurt to round the individual numbers before the calculations and then the final result at the end rather than just round the end value.
only outputted whole integers, not full floating point values or decimals, which was the cause of the issue, this wasn’t even a floating point error which I thought it was
So it when it came to the addition, it was adding, say, 0.1 to 4999 when it was meant to be adding 0.1 to 4999.9