Re: help needed on decimal formatting issue

2011-09-19 Thread Mark Dickinson
On Sep 19, 1:42 pm, Robin Becker wrote: > I'm not really very used to the decimal module so I'm asking here if any one > can > help me with a problem in a well known third party web framework > > The code in question is > > def format_number(value, max_digits, decimal_places): >      """ >      F

help needed on decimal formatting issue

2011-09-19 Thread Robin Becker
I'm not really very used to the decimal module so I'm asking here if any one can help me with a problem in a well known third party web framework The code in question is def format_number(value, max_digits, decimal_places): """ Formats a number into a string with the requisite number of

Re: Decimal formatting

2007-09-13 Thread Aahz
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > a >12.3 print '%0.2f' % a >12.33 a = 1 print '%0.2f' % a >1.00 >>> '%.2f' % 1 '1.00' -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Many customs in this life per

Re: Decimal formatting

2007-09-13 Thread Zentrader
The documentation is here http://docs.python.org/lib/typesseq-strings.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal formatting

2007-09-13 Thread [EMAIL PROTECTED]
On Sep 13, 3:50 pm, Harlin Seritt <[EMAIL PROTECTED]> wrote: > Cant believe I have to post this and get help... and can't believe I > couldnt Google it reasonably well enough... I need to take a float > variable and have it display as a string to always have two decimal > places: > > 12. -> 12.

Re: Decimal formatting

2007-09-13 Thread J. Clifford Dyer
On Thu, Sep 13, 2007 at 01:50:51PM -0700, Harlin Seritt wrote regarding Decimal formatting: > > Cant believe I have to post this and get help... and can't believe I > couldnt Google it reasonably well enough... I need to take a float > variable and have it display as a string t

Decimal formatting

2007-09-13 Thread Harlin Seritt
Cant believe I have to post this and get help... and can't believe I couldnt Google it reasonably well enough... I need to take a float variable and have it display as a string to always have two decimal places: 12. -> 12.33 1.0 -> 1.00 etc... Anyone willing to help with this one? thanks, H