You can use the .removesuffix method (Python 3.9+):
>>> str(24.125).removesuffix(".0")
'24.125'
>>> str(25.0).removesuffix(".0")
'25'
You can use the .removesuffix method (Python 3.9+):
>>> str(24.125).removesuffix(".0")
'24.125'
>>> str(25.0).removesuffix(".0")
'25'