Knowledgebase
Smarty: number_format
Posted by - NA - on 20 February 2008 10:38 PM
|
|
http://smarty.incutio.com/?page=NumberFormatPlugin {$var|number_format:digits in fractional part: separator in whole part: separator in fractional part} e.g.: {$var|number_format:0:',':'.'} outputs 12,345,678 {$var|number_format:2:',':'.'} outputs 12,345,678.00 {$var|number_format:3:',':'.'} outputs 12,345,678.000 {$var|number_format:3:' ':'.'} outputs 12 345 678.000 In order to make your "Price" field to be displayed like the following "12,345,678.00", you need to put the following code to all templates which displays this field (for example, to listing_details.tpl) (for the v.4.3.0 and higher): <tr><td><b>[[FormFieldCaptions!Price]]:</b> {$GLOBALS.custom_settings.listing_currency} [[$listing.Price|number_format:2:',':'.']]</td></tr> | |
|
Comments (0)