Numbers_Words
[ class tree: Numbers_Words ] [ index: Numbers_Words ] [ all elements ]

Class: Numbers_Words

Source Location: /Numbers_Words-0.18.0/Numbers/Words.php

Class Overview


The Numbers_Words class provides method to convert arabic numerals to words.


Author(s):

Variables

Methods


Child classes:

Numbers_Words_Locale_fr_BE
Class for translating numbers into French (Belgium).
Numbers_Words_Locale_sv
Class for translating numbers into Swedish.
Numbers_Words_Locale_de
Class for translating numbers into German.
Numbers_Words_Locale_en_GB
Class for translating numbers into British English.
Numbers_Words_Locale_en_100
Class for translating numbers into Donald Knuth system, in English language.
Numbers_Words_Locale_en_US
Class for translating numbers into American English.
Numbers_Words_Locale_nl
Class for translating numbers into Dutch.
Numbers_Words_Locale_id
Class for translating numbers into Indonesian.
Numbers_Words_Locale_bg
Class for translating numbers into Bulgarian.
Numbers_Words_Locale_pt_BR
Class for translating numbers into Brazilian Portuguese. This class complies to Brazilian Academy of Letters rules as of 2008-12-12.
Numbers_Words_Locale_it_IT
Class for translating numbers into Italian.
Numbers_Words_Locale_fr
Class for translating numbers into French.
Numbers_Words_Locale_es_MX
Class for translating numbers into Argentinian Spanish.
Numbers_Words_Locale_es_VE
Class for translating numbers into Venezuelan Spanish.
Numbers_Words_Locale_es_AR
Class for translating numbers into Argentinian Spanish.
Numbers_Words_Locale_lt
Class for translating numbers into Lithuanian.
Numbers_Words_Locale_et
Class for translating numbers into Estonian.
Numbers_Words_Locale_ru
Class for translating numbers into Russian.
Numbers_Words_Locale_tr_TR
Class for translating numbers into Italian.
Numbers_Words_Locale_dk
Class for translating numbers into Danish.
Numbers_Words_Locale_pl
Class for translating numbers into Polish.
Numbers_Words_Locale_cs
Class for translating numbers into Czech.
Numbers_Words_Locale_hu_HU
Class for translating numbers into Hungarian.
Numbers_Words_Locale_he
Class for translating numbers into Hebrew.
Numbers_Words_Locale_es
Class for translating numbers into Spanish (Castellano).

Inherited Variables

Inherited Methods


Class Details

[line 41]
The Numbers_Words class provides method to convert arabic numerals to words.


[ Top ]


Class Variables

$decimalPoint =  '.'

[line 85]

Default decimal mark
  • Access: public

Type:   string


[ Top ]

$locale =  'en_US'

[line 78]

Default Locale name
  • Access: public

Type:   string


[ Top ]



Method Detail

getLocales   [line 232]

array getLocales( [mixed $locales = null])

Lists available locales for Numbers_Words
  • Return: The available locales (optionaly only the requested ones)
  • Author: Bertrand Gugger, bertrand at toggg dot com
  • Author: Piotr Klaban <makler@man.torun.pl>
  • Access: public

Parameters:

mixed   $locales     string/array of strings $locale Optional searched language name abbreviation. Default: all available locales.

[ Top ]

loadLocale   [line 278]

string loadLocale( string $locale, string $requiredMethod)

Load the given locale and return class name
  • Return: Locale class name
  • Throws: Numbers_Words_Exception When the class cannot be loaded
  • Access: public

Parameters:

string   $locale     Locale key, e.g. "de" or "en_US"
string   $requiredMethod     Method that this class needs to have

[ Top ]

normalizeNumber   [line 313]

string normalizeNumber( string $num, [string $decimalPoint = null])

Removes redundant spaces, thousands separators, etc.
  • Return: Number

Parameters:

string   $num     Some number
string   $decimalPoint     The decimal mark, e.g. "." or ","

[ Top ]

toCurrency   [line 159]

string toCurrency( float $num, [string $locale = 'en_US'], [string $intCurr = ''], [string $decimalPoint = null])

Converts a currency value to word representation (1.02 => one dollar two cents) If the number has not any fraction part, the "cents" number is omitted.
  • Return: The corresponding word representation
  • Author: Piotr Klaban <makler@man.torun.pl>
  • Since: PHP 4.2.3
  • Access: public

Parameters:

float   $num     A float/integer/string number representing currency value
string   $locale     Language name abbreviation. Optional. Defaults to en_US.
string   $intCurr     International currency symbol as defined by the ISO 4217 standard (three characters). E.g. 'EUR', 'USD', 'PLN'. Optional. Defaults to $def_currency defined in the language class.
string   $decimalPoint     Decimal mark symbol E.g. '.', ','. Optional. Defaults to $decimalPoint defined in the language class.

[ Top ]

toWords   [line 104]

string toWords( integer $num, [string $locale = ''], [array $options = array()])

Converts a number to its word representation
  • Return: The corresponding word representation
  • Author: Piotr Klaban <makler@man.torun.pl>
  • Since: PHP 4.2.3
  • Access: public

Parameters:

integer   $num     An integer between -infinity and infinity inclusive :) that should be converted to a words representation
string   $locale     Language name abbreviation. Optional. Defaults to current loaded driver or en_US if any.
array   $options     Specific driver options

[ Top ]


Documentation generated on Fri, 24 Oct 2014 16:30:19 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.