var hours = 1.2;
var minutes = ((int)hours) * 60 + (hours%1)*100;
And a side note: such way of inputting time is IMO not a good one. It'll be confusing and I guess that more often than not people will be actually entering 1:20
instead of 1.2
, which'll break your application. And if not, they might be entering 1.5
thinking of 90
minutes. I know I would have done it like that.