Use a float or double type, like the others already mentioned.
But it is not so simple. You need to understand what floating point numbers are and why (0.1 + 0.1 + 0.1)! = (0.3). This is a difficult question, so I wonβt even try to explain it here - just remember that the float is not decimal, even if the computer displays it to you as decimal.
source share