How to Converting an Integer into Decimals using python Example
#How Converting an Integer into Decimals using python Example
import decimal integer = 100 print(decimal.Decimal(integer)) print(type(decimal.Decimal(integer)))
To convert an integer into decimals in Python, you can easily use the decimal point to represent the decimal part of the number.
you can use alternate method for it decimal_number = round(float(integer_number), 2) So this can help us to convert into float.