Knowledgebase: Template Customization
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>

(1133 votes)
This article was helpful
This article was not helpful

Comments (0)
Post a new comment 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako Fusion