[Zope] dtml decimals

Dieter Maurer dieter@handshake.de
Wed, 13 Dec 2000 23:27:48 +0100 (CET)


Andy McKay writes:
 > <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?
This is a Python feature:

  If both arguments are integers, the division is performed
  as an integer division.

  Use "3.0/2" or "3/2.0" or "float(3)/2"  to get a floating point division.


Dieter