Smarty | Modifier | Number Format

Usage:

|number_format[:decimal_digits[:decimal_char[:thousands_char]]]

Example:

// php file

$smarty->assign( ‘number’, ’12345.678′ );

// template

Number format: {$number|number_format:2:”.”:”,”}

// output

Number format: 12,345.68

*** You can use any php function as modifier ***

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>