How do I apply this in VB? How do I get the number after the comma, multiplied by 60?
How do I apply this in VB? How do I get the number after the comma, multiplied by 60?
You can get the decimal part of the number like this:
parte_decimal = (valor - Int(valor))
So you subtract the whole part, leaving only the decimal part.
A good solution would be to use the conversion function for INT in your variable. So the difference between the two (Real - Integer) would give you the number after the comma.
Example:
Valor_Total = 4,70
valor_decimal = (Valor_Total - Int(Valor_Total))
total_minutos = valor_decimal * 60
MessageBox.Show ("Total de minutos: " + (Int(Valor_Total)ToString() + ":" + total_minutos.ToString())
Total minutes: 4:42
Well this is just one solution, but there are many others available!