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

Class: Numbers_Words

Source Location: /Numbers_Words-0.16.1/Words.php

Class Overview


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


Author(s):

Methods


Child classes:

Numbers_Words_es_AR
Class for translating numbers into Argentinian Spanish.
Numbers_Words_he
Class for translating numbers into Hebrew.
Numbers_Words_sv
Class for translating numbers into Swedish.
Numbers_Words_cs
Class for translating numbers into Czech.
Numbers_Words_es
Class for translating numbers into Spanish (Castellano).
Numbers_Words_id
Class for translating numbers into Indonesian.
Numbers_Words_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_hu_HU
Class for translating numbers into Hungarian.
Numbers_Words_en_100
Class for translating numbers into Donald Knuth system, in English language.
Numbers_Words_bg
Class for translating numbers into Bulgarian.
Numbers_Words_fr
Class for translating numbers into French.
Numbers_Words_de
Class for translating numbers into German.
Numbers_Words_et
Class for translating numbers into Estonian.
Numbers_Words_nl
Class for translating numbers into Dutch.
Numbers_Words_pl
Class for translating numbers into Polish.
Numbers_Words_lt
Class for translating numbers into Lithuanian.
Numbers_Words_en_GB
Class for translating numbers into British English.
Numbers_Words_en_US
Class for translating numbers into American English.
Numbers_Words_dk
Class for translating numbers into Danish.
Numbers_Words_fr_BE
Class for translating numbers into French (Belgium).
Numbers_Words_it_IT
Class for translating numbers into Italian.
Numbers_Words_ru
Class for translating numbers into Russian.

Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Method Detail

getLocales   [line 155]

array getLocales( [mixed $locale = 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   $locale     string/array of strings $locale Optional searched language name abbreviation. Default: all available locales.

[ Top ]

raiseError   [line 193]

PEAR_Error raiseError( string $msg)

Trigger a PEAR error

To improve performances, the PEAR.php file is included dynamically.


Parameters:

string   $msg     error message

[ Top ]

toCurrency   [line 105]

string toCurrency( float $num, [string $locale = 'en_US'], [string $int_curr = ''])

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   $int_curr     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.

[ Top ]

toWords   [line 56]

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

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

Overridden in child classes as:

Numbers_Words_he::toWords()
Converts a number to its word representation
Numbers_Words_cs::toWords()
Converts a number to its word representation in Czech language
Numbers_Words_id::toWords()
Converts a number to its word representation in Indonesian language
Numbers_Words_pt_BR::toWords()
Converts a number to its word representation in Brazilian Portuguese language
Numbers_Words_hu_HU::toWords()
Converts a number to its word representation in the Hungarian language
Numbers_Words_en_100::toWords()
Converts a number to its word representation in Donald Knuth system, in English language.
Numbers_Words_bg::toWords()
Converts a number to its word representation in Bulgarian language.
Numbers_Words_fr::toWords()
Converts a number to its word representation in French language.
Numbers_Words_de::toWords()
Converts a number to its word representation in German language.
Numbers_Words_et::toWords()
Converts a number to its word representation in Estonian language
Numbers_Words_nl::toWords()
Converts a number to its word representation in Dutch language.
Numbers_Words_pl::toWords()
Converts a number to its word representation in Polish language
Numbers_Words_lt::toWords()
Converts a number to its word representation in Lithuanian language
Numbers_Words_en_GB::toWords()
Converts a number to its word representation in British English language
Numbers_Words_en_US::toWords()
Converts a number to its word representation in American English language
Numbers_Words_dk::toWords()
Converts a number to its word representation in Danish language
Numbers_Words_fr_BE::toWords()
Converts a number to its word representation in French language.
Numbers_Words_it_IT::toWords()
Converts a number to its word representation in italiano.

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 en_US.

[ Top ]


Documentation generated on Sat, 14 Mar 2009 19:30:19 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.