I am working with Python and have two strings which contain float style values, For example:
a = '0.0000001'
b = '0.0003599'
I am looking for a solution to simply add or subtract the two values together to a new string, keeping the decimal precision intact. I have tried converting them to a float and using a + b etc but this seems to be inconsistent.
So the resulting string in this example would be string
c = '0.0003600'
I've been over a number of examples/methods and not quite found the answer. Any help appreciated.
decimalmodule?'0.0003600'rather than'0.00036'? And you don't know ahead of time how many decimals will be required?