Question by
cmeklensek · Oct 01, 2020 at 08:59 AM ·
floatint
Help with float and int,Help with float and integer
I have written this and it keeps providing the incorrect result. Where input amount is 1200:
float a = InputAMT / 6;
int b = Mathf.FloorToInt(a);
int c = b * 6;
float d = c / 1.2f;
float e = d * 0.95f
f += Mathf.FloorToInt(e);
f is spitting out 949 when it should be 950 (1200/6 = 200 x 6 = 1200 / 1.2 = 1000 x .95 = 950. Can anyone help with this. The input amount will always be a whole number without decimals.
Thanks for any help
Comment