Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SMW\DataValues\Number\IntlNumberFormatter Class Reference

Public Member Functions

 __construct ( $maxNonExpNumber)
 
 clear ()
 
 reset ()
 
 setOption ( $key, $value)
 
 getSeparatorByLanguage ( $type, $locale='')
 
 format ( $value, $precision=false, $format='')
 

Static Public Member Functions

static getInstance ()
 

Public Attributes

const CONTENT_LANGUAGE = Message::CONTENT_LANGUAGE
 
const USER_LANGUAGE = Message::USER_LANGUAGE
 
const PREFERRED_LANGUAGE = 'preferred.language'
 
const DECIMAL_SEPARATOR = NumberValue::DECIMAL_SEPARATOR
 
const THOUSANDS_SEPARATOR = NumberValue::THOUSANDS_SEPARATOR
 
const DEFAULT_FORMAT = 'default.format'
 
const VALUE_FORMAT = 'value.format'
 

Detailed Description

GNU GPL v2+

Since
2.1
Author
mwjames
Markus Krötzsch

Constructor & Destructor Documentation

◆ __construct()

SMW\DataValues\Number\IntlNumberFormatter::__construct (   $maxNonExpNumber)
Since
2.1
Parameters
integer$maxNonExpNumber

Member Function Documentation

◆ clear()

SMW\DataValues\Number\IntlNumberFormatter::clear ( )
Since
2.1

◆ format()

SMW\DataValues\Number\IntlNumberFormatter::format (   $value,
  $precision = false,
  $format = '' 
)

This method formats a float number value according to the given language and precision settings, with some intelligence to produce readable output. Used to format a number that was not hand-formatted by a user.

Parameters
mixed$valueinput number
integer | false$precisionoptional positive integer, controls how many digits after the decimal point are shown
string | integer$format
Since
2.1
Returns
string

◆ getInstance()

static SMW\DataValues\Number\IntlNumberFormatter::getInstance ( )
static
Since
2.1
Returns
IntlNumberFormatter

◆ getSeparatorByLanguage()

SMW\DataValues\Number\IntlNumberFormatter::getSeparatorByLanguage (   $type,
  $locale = '' 
)
Since
2.4
Parameters
integer$type
string | integer$locale
Returns
string

◆ reset()

SMW\DataValues\Number\IntlNumberFormatter::reset ( )
Since
2.4

◆ setOption()

SMW\DataValues\Number\IntlNumberFormatter::setOption (   $key,
  $value 
)
Since
2.4
Parameters
string$key
mixed$value
Returns
void

Member Data Documentation

◆ CONTENT_LANGUAGE

const SMW\DataValues\Number\IntlNumberFormatter::CONTENT_LANGUAGE = Message::CONTENT_LANGUAGE

Localization related constants

◆ DECIMAL_SEPARATOR

const SMW\DataValues\Number\IntlNumberFormatter::DECIMAL_SEPARATOR = NumberValue::DECIMAL_SEPARATOR

Separator related constants

◆ DEFAULT_FORMAT

const SMW\DataValues\Number\IntlNumberFormatter::DEFAULT_FORMAT = 'default.format'

Format related constants


The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy