I feel stoopid ... this code is to verbose

ruud de rooij * at spam.ruud.org
Fri Jun 14 13:30:58 EDT 2002


Max M <maxm at mxm.dk> writes:

> 42.000.000,00 which is 42 millions
> 
> So I need to insert dot's at every three character from end of the
> string for the integer value of the number.

import locale
locale.setlocale(locale.LC_NUMERIC, 'da_DK')
locale.format('%.2f', 42000000.00, 1)

batteries-included-ly y'rs,

        - ruud
-- 
ruud de rooij | *@spam.ruud.org | http://ruud.org



More information about the Python-list mailing list