How to convert a Decimal to Number(with decimal numbers) in Python
Question:
Suppose, I have a decimal expansion 2.896. I want to convert it to something like 2896. How can I achieve this in Python?
Answers:
Try this;
n = 2.896
n1 = int(str(n).replace(".",""))
Suppose, I have a decimal expansion 2.896. I want to convert it to something like 2896. How can I achieve this in Python?
Try this;
n = 2.896
n1 = int(str(n).replace(".",""))