PDA

View Full Version : Template, show a number with 2 decimals



PatrickS
11 Oct 2010, 6:23 AM
Hi,

In my datastore I have a number. I display the data with a dataview that uses a template. How can I show the number with 2 decimals? At this moment the trainling 0 are suppressed.

Patrick

Animal
11 Oct 2010, 6:42 AM
<deep sigh......>

Again.

It's very well documented in its API docs:

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/xtemplatedocs.jpg

And as I say every 2 days when someone asks about templates:

Practice with XTemplate on the console command line

Paste this into Firebug:



new Ext.XTemplate('{value:number("0.00")}').apply({value: 5.357})