I have been trying to fix the precision issue in my code that has been breaking. I want the value to be presented exactly as i provided but it seems like Python is rounding up the number. Below is the sample.
x = 3069682093880544.81
print (x)
3069682093880545.0
x = Decimal(3069682093880544.81)
print (x)
3069682093880545
x = float(3069682093880544.81)
print(x)
3069682093880545.0
x = Decimal(str(3069682093880544.81))
print(x)
3069682093880545.0
3069682093880545.0
x = str(3069682093880544.81)
print(x)
3069682093880545.0
All i want is to be able to assign exact value to the variable and it provides me the same value when called. What am i doing wrong?