Suppose i have numeric string. I would like to remove all the trailing zeros and also the decimal point if necessary. For example -
'0.5' -> '.5'
'0005.00' -> '5'
I used this method :
s.strip("0") # where 's' contains the numeric string.
But for the 0005.00, it returns 5., so how would i remove the decimal point if necessary.