I am writing a python code where I provide 2 strings as input and the program should give me sum of those numbers as response in string format.
def sum(s1, s2):
return str(float(s1) + float(s2))
This works fine if my input s1 and s2 are small float values example 3.6, 2.1 gives me 5.7
But I have some issues here:
case 1:
IF input is s1=3, s2 = 5, I want output as 8, but the program gives me 8.0
case 2:
If input is s1=100000000000000000000000000000001 and s2 = 100000000000000000000000000000002, I want output as 200000000000000000000000000000003, but the program gives me 2e+32
What changes I have to do to this code? can you please help me.
I am using Python 3.