Re: [Zope] dtml decimals
14 Dec
2000
14 Dec
'00
1:18 p.m.
Andy McKay <andym@ActiveState.com> wrote:
<dtml-var "3/2" fmt="%.2d"> instead of getting 1.50 as I was expecting I get 1.00, I never seem to be getting decimals. Whats the obivous thing Im missing here?
Note the following:: $ python Python 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC egcs-2.91.66 1... Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
3/2 1 3.0/2 1.5
Python performs integer division when handed integer arguments; you need:: <dtml-var "3.0/2" fmt="%.2d"> <dtml-var "_.float( x )/2" fmt="%.2d"> or equivalent. Tres. -- =============================================================== Tres Seaver tseaver@digicool.com Digital Creations "Zope Dealers" http://www.zope.org
9244
Age (days ago)
9244
Last active (days ago)
0 comments
1 participants
participants (1)
-
Tres Seaver