import the decimal module to use the Decimal number class. : decimal « Data Type « Python Tutorial






import decimal 


dec = decimal.Decimal('.1')
print dec
dec + decimal.Decimal('1.0')
print dec + decimal.Decimal('1.0')








2.4.decimal
2.4.1.Convert string to decimal
2.4.2.import the decimal module to use the Decimal number class.
2.4.3.Decimal function
2.4.4.Set precision
2.4.5.decimal type