I need to write a decimal with 0/zero precision, but I want it to include the decimal point. I am using f-strings.
This is what I have tried:
test = f"{8:3.0f}"
print(test)
Out 8
As well as just doing:
test = f"{8:3.0f}" + "."
print(test)
Out 8.
And
test = f"{8:2.0f}" + "."
print(test)
Out 8.
The last is what I want, but I want the decimal point "." to be included as one of the 3 characters as this is a format specific issue. So when the code is read, it reads a 3 size float that is ' 8.'
Is there a way to do this?