LocalizedNumber
extends AbstractHelper
in package
Class NumberFormat allows localization based formatting of numbers in view
Tags
Table of Contents
- $defaultDecimalPoint : string
- Default decimal point character
- $defaultThousandSep : string
- Default thousands separator character
- __invoke() : string
- Localize number
Properties
$defaultDecimalPoint
Default decimal point character
protected
string
$defaultDecimalPoint
= '.'
$defaultThousandSep
Default thousands separator character
protected
string
$defaultThousandSep
= ','
Methods
__invoke()
Localize number
public
__invoke(int|float $number, int $decimals[, bool $escapeHtml = true ]) : string
Parameters
- $number : int|float
-
Number to format
- $decimals : int
-
How many decimal places?
- $escapeHtml : bool = true
-
Should we escape the resulting text as HTML?