babadbee babadbee - 1 month ago 6
Smarty Question

Formatting numbers with thousands separator Smarty PHP

Im trying to format numbers with thousands separator Smarty.

So for example 1000 becomes 1,000.

Thanks.

Answer

or you can use php function inside smarty, this is for number_format, you can use other php function too :)

PHP : number_format($number, 2, '.', ',');

SMARTY :
{$number|number_format:2:".":","}