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
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
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
The documentation is here
http://docs.python.org/lib/typesseq-strings.html
--
http://mail.python.org/mailman/listinfo/python-list
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.
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
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