modifier.crmNumberFormat.php
Tags
Table of Contents
Functions
- smarty_modifier_crmNumberFormat() : string
- Add thousands separator to numeric strings using PHP number_format() function.
Functions
smarty_modifier_crmNumberFormat()
Add thousands separator to numeric strings using PHP number_format() function.
smarty_modifier_crmNumberFormat(float $number[, int $decimals = 0 ][, string $dec_point = NULL ][, string $thousands_sep = NULL ]) : string
Parameters
- $number : float
-
Numeric value to be formatted.
- $decimals : int = 0
-
Number of decimal places.
- $dec_point : string = NULL
-
Decimal point character (if other than ".").
- $thousands_sep : string = NULL
-
Thousands sep character (if other than ",").
Return values
string —the formatted string
For alternate decimal point and thousands separator, delimit values with single quotes in the template. EXAMPLE: {$number|crmNumberFormat:2:',':' '} for French notation - 1234.56 becomes 1 234,56