15 Jan, 2013, Bojack wrote in the 1st comment:
Votes: 0
Hey, simple question.. just cant remember how to add or at least grab just the .000 side of a decimal. Example: 1.20 + 1.20 = 1.40 The reason I want this is because we have a repair system and the rate is transferred into a float. So if the dev wants rate of 120, the formula is 120/100 where 100 is 1hp per second. So they'll always get 1hp a second with the addition of getting .1 each second till the whole number is 2 then restart counter again. Anyone have an idea on this without using a string?
15 Jan, 2013, Runter wrote in the 2nd comment:
Votes: 0
15 Jan, 2013, Bojack wrote in the 3rd comment:
Votes: 0
Thanks runter, also I found another way.
double value = (((double)_type.RepairRate) / 100);
output = 1.25
value -= (int)value;
output = 0.25