[Zope] Question about dtml-var, "null=", and data types

Passin,Thomas B. (Tom) tpassin@mitretek.org
Wed, 11 Sep 2002 12:21:24 -0400


[ Jean-Francois.Doyon]
>=20
> Thanks for this.  The reason I need to do the int() is=20
> because the underlying data is float is was getting 123.0 ...=20
> And I don't want the decimals to show at all.
>=20

Use a format string, like

<dtml-var value fmt=3D"%.0f" null=3D"N/A">

Just read up on format strings in the help (really, in the Python
manual) to get the format that you want.

> Mind you no matter how I do it, I can't seem to get the int()=20
> and "null=3D" functioning properly together.
>=20

The above works correctly whether or not there is a null.=20

Cheers,

Tom P=20