Im making an idle clicker game and i want to show the current score and that works good but i have a production per second in this case its currently 0.2 and when i add that to the scoor it seems to work great in the beginning but once it gets to 3 its returns 3.000000001 when it gets to 4 everything is normal again but once it gets to 5 it turns into 5.199999999. Can anybody tell me why and what i need to change? and how do i get it to not show Decimals at all ive tried the rounding functions but that didnt seem to work
// Used for displaying the score
float score = Click.score;
Mathf.Floor(score);
string counting = ("Collected:" + score);
score_UIText.text = counting;
// Adding the Productions per second(0.2 in this case) to the score
score = score + pps;
Debug.Log(score);
Debug.Log(pps)
;
pps and score are both floats