Try this:

[% number = 1.2345 %]

[% number | format('%.2f') %]

Regards

Simon


> -----Original Message-----
> From: Jason Lewis [mailto:[EMAIL PROTECTED] 
> Sent: 06 January 2004 07:19
> To: [EMAIL PROTECTED]
> Subject: [Templates] rounding numbers and fixing decimal points
> 
> 
> Hi,
> 
> I have a variable, item.price, which contains the price of a 
> product to 4 
> decimal places. But I need to fix it to 2 decimal places for 
> output. should i 
> write a filter to do that or is there some other way that I 
> have missed?
> 
> Thanks,
> 
> Jason
> -- 
> 
> 
> 
> Jason Lewis
> -------------------------------------------------
> please note my new email address [EMAIL PROTECTED]
> 
> 
> _______________________________________________
> templates mailing list
> [EMAIL PROTECTED] 
> http://lists.template-> toolkit.org/mailman/listinfo/templates
> 

_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to