-1

I am having a simple problem i want to get value after decimal points,Here is my code,

float result = slotSize/60;//slot size is int and 57

I want result 0.95 ,but i am getting 0,please help me.I tried ceil value method but it gives 1 and floor value method gives 0.

1 Answers1

0

You need to change your slotSize type from Int to Float.

Shamas S
  • 7,507
  • 10
  • 46
  • 58
  • 2
    While this is one option, it is not required. Simply change 60 to 60.0 and leave slotSize an int. – rmaddy Apr 03 '15 at 12:37