rounding of a decimal object

Yuan HOng hongyuan1306 at gmail.com
Tue Jul 18 10:37:15 EDT 2006


How can I round a decimal object to desired decimal position? It seems
you have to use some unintuitive expression like:

Decimal('7.325').quantize(Decimal('.01'))

why not simply use Decimal('7.325').round(2) or just round(Decimal('7.325'), 2)?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn


More information about the Python-list mailing list