Tag Archives: Smarty

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 ***