I'm sorry, I know this must be a duplicate, I can't find where else it's posted. Please feel free to link me to the original question and mark this as duplicate.
I would like to print a 3 digits of a number AFTER the decimal point in it. For example:
number = 523.637382
I would like to print: 523.637 I have a feeling I can use something similar to this
print(str(number)[:7])
>>>523.637
However, this will not work if the number before the decimal is not 3 decimals.
Bonus points: Would this be easy?
number = 500.220
#magic
>>>500.22
number = 500.2000003
#magic
>>>500.2