-
Notifications
You must be signed in to change notification settings - Fork 35
string_format
Umakant Patil edited this page Aug 14, 2017
·
2 revisions
This is a way to format strings, such as decimal numbers and such. Use the syntax for sprintf() for the formatting.
This modifier uses Javascript port of PHP function sprintf(). You can find one at phpjs.org
Parameter Position | Type | Required | Default | Description |
---|---|---|---|---|
1 | string | Yes | n/a | This is what format to use. (sprintf) |
Template:
{$articleTitle = 23.5787446}
{$number}
{$number|string_format:"%.2f"}
{$number|string_format:"%d"}
output:
23.5787446
23.58
23