Does anyone know how to convert int
to float
.
For some reason, it keeps on printing 0. I want it to print a specific decimal.
The answers provided above are absolutely correct and worth to read but I just wanted to give a straight forward answer to the question.
The question asked is just a type conversion question and here its conversion from int
data type to float
data type and for that you can do it by the function :
float()
And for more details you can visit this page.