Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > rounding of a decimal object

Thread Tools

rounding of a decimal object

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


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

Hong Yuan

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal rounding function Bubba C Programming 24 12-04-2009 08:46 PM
printing float to string with decimal rounding Josselin Ruby 3 05-24-2007 05:49 AM
DataGridItemEventArgs dataitem decimal value rounding =?Utf-8?B?U3Vl?= ASP .Net 2 06-26-2006 03:28 PM
Java rounding with big Decimal. ChrisMM Java 8 04-15-2006 04:10 AM
rounding to n decimal digits David Garamond Ruby 5 06-27-2004 06:31 PM