VuFind API Documentation

LocalizedNumber extends AbstractHelper
in package

Class NumberFormat allows localization based formatting of numbers in view

Tags
category

VuFind

author

Nicolas Karrer nkarrer@snowflake.ch

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

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?

Return values
string

Search results