home *** CD-ROM | disk | FTP | other *** search
- <?php
- /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
- //
- // +----------------------------------------------------------------------+
- // | PHP version 4 |
- // +----------------------------------------------------------------------+
- // | Copyright (c) 1997-2003 The PHP Group |
- // +----------------------------------------------------------------------+
- // | This source file is subject to version 3.0 of the PHP license, |
- // | that is bundled with this package in the file LICENSE, and is |
- // | available at through the world-wide-web at |
- // | http://www.php.net/license/3_0.txt. |
- // | If you did not receive a copy of the PHP license and are unable to |
- // | obtain it through the world-wide-web, please send a note to |
- // | license@php.net so we can mail you a copy immediately. |
- // +----------------------------------------------------------------------+
- // | Authors: Piotr Klaban <makler@man.torun.pl> |
- // | Andrey Demenev <demenev@gmail.com> |
- // +----------------------------------------------------------------------+
- //
- // $Id: lang.ru.php,v 1.3 2006/06/12 13:50:07 makler Exp $
- //
- // Numbers_Words class extension to spell numbers in Russian language.
- //
-
- /**
- * Class for translating numbers into Russian.
- *
- * @author Andrey Demenev
- * @package Numbers_Words
- */
-
- /**
- * Include needed files
- */
- require_once("Numbers/Words.php");
-
- /**
- * Class for translating numbers into Russian.
- *
- * @author Andrey Demenev
- * @package Numbers_Words
- */
- class Numbers_Words_ru extends Numbers_Words
- {
-
- // {{{ properties
-
- /**
- * Locale name
- * @var string
- * @access public
- */
- var $locale = 'ru';
-
- /**
- * Language name in English
- * @var string
- * @access public
- */
- var $lang = 'Russian';
-
- /**
- * Native language name
- * @var string
- * @access public
- */
- var $lang_native = '╨≤±±ΩΦΘ';
-
- /**
- * The word for the minus sign
- * @var string
- * @access private
- */
- var $_minus = '∞Φφ≤±'; // minus sign
-
- /**
- * The sufixes for exponents (singular)
- * Names partly based on:
- * http://home.earthlink.net/~mrob/pub/math/largenum.html
- * http://mathforum.org/dr.math/faq/faq.large.numbers.html
- * http://www.mazes.com/AmericanNumberingSystem.html
- * @var array
- * @access private
- */
- var $_exponent = array(
- 0 => '',
- 6 => '∞ΦδδΦεφ',
- 9 => '∞ΦδδΦα≡Σ',
- 12 => '≥≡ΦδδΦεφ',
- 15 => 'ΩΓαΣ≡ΦδδΦεφ',
- 18 => 'ΩΓΦφ≥ΦδδΦεφ',
- 21 => '±σΩ±≥ΦδδΦεφ',
- 24 => '±σ∩≥ΦδδΦεφ',
- 27 => 'εΩ≥ΦδδΦεφ',
- 30 => 'φεφΦδδΦεφ',
- 33 => 'Σσ÷ΦδδΦεφ',
- 36 => '≤φΣσ÷ΦδδΦεφ',
- 39 => 'Σ≤εΣσ÷ΦδδΦεφ',
- 42 => '≥≡σΣσ÷ΦδδΦεφ',
- 45 => 'ΩΓα≥≤ε≡Σσ÷ΦδδΦεφ',
- 48 => 'ΩΓΦφΣσ÷ΦδδΦεφ',
- 51 => '±σΩ±Σσ÷ΦδδΦεφ',
- 54 => '±σ∩≥σφΣσ÷ΦδδΦεφ',
- 57 => 'εΩ≥εΣσ÷ΦδδΦεφ',
- 60 => 'φεΓσ∞Σσ÷ΦδδΦεφ',
- 63 => 'ΓΦπΦφ≥ΦδδΦεφ',
- 66 => '≤φΓΦπΦφ≥ΦδδΦεφ',
- 69 => 'Σ≤εΓΦπΦφ≥ΦδδΦεφ',
- 72 => '≥≡σΓΦπΦφ≥ΦδδΦεφ',
- 75 => 'ΩΓα≥≤ε≡ΓΦπΦφ≥ΦδδΦεφ',
- 78 => 'ΩΓΦφΓΦπΦφ≥ΦδδΦεφ',
- 81 => '±σΩ±ΓΦπΦφ≥ΦδδΦεφ',
- 84 => '±σ∩≥σφΓΦπΦφ≥ΦδδΦεφ',
- 87 => 'εΩ≥εΓΦπΦφ≥ΦδδΦεφ',
- 90 => 'φεΓσ∞ΓΦπΦφ≥ΦδδΦεφ',
- 93 => '≥≡ΦπΦφ≥ΦδδΦεφ',
- 96 => '≤φ≥≡ΦπΦφ≥ΦδδΦεφ',
- 99 => 'Σ≤ε≥≡ΦπΦφ≥ΦδδΦεφ',
- 102 => '≥≡σ≥≡ΦπΦφ≥ΦδδΦεφ',
- 105 => 'ΩΓα≥ε≡≥≡ΦπΦφ≥ΦδδΦεφ',
- 108 => 'ΩΓΦφ≥≡ΦπΦφ≥ΦδδΦεφ',
- 111 => '±σΩ±≥≡ΦπΦφ≥ΦδδΦεφ',
- 114 => '±σ∩≥σφ≥≡ΦπΦφ≥ΦδδΦεφ',
- 117 => 'εΩ≥ε≥≡ΦπΦφ≥ΦδδΦεφ',
- 120 => 'φεΓσ∞≥≡ΦπΦφ≥ΦδδΦεφ',
- 123 => 'ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 126 => '≤φΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 129 => 'Σ≤εΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 132 => '≥≡σΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 135 => 'ΩΓα≥ε≡ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 138 => 'ΩΓΦφΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 141 => '±σΩ±ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 144 => '±σ∩≥σφΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 147 => 'εΩ≥εΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 150 => 'φεΓσ∞ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
- 153 => 'ΩΓΦφΩΓαπΦφ≥ΦδδΦεφ',
- 156 => '≤φΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 159 => 'Σ≤εΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 162 => '≥≡σΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 165 => 'ΩΓα≥ε≡ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 168 => 'ΩΓΦφΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 171 => '±σΩ±ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 174 => '±σ∩≥σφΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 177 => 'εΩ≥εΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 180 => 'φεΓσ∞ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
- 183 => '±σΩ±απΦφ≥ΦδδΦεφ',
- 186 => '≤φ±σΩ±απΦφ≥ΦδδΦεφ',
- 189 => 'Σ≤ε±σΩ±απΦφ≥ΦδδΦεφ',
- 192 => '≥≡σ±σΩ±απΦφ≥ΦδδΦεφ',
- 195 => 'ΩΓα≥ε≡±σΩ±απΦφ≥ΦδδΦεφ',
- 198 => 'ΩΓΦφ±σΩ±απΦφ≥ΦδδΦεφ',
- 201 => '±σΩ±±σΩ±απΦφ≥ΦδδΦεφ',
- 204 => '±σ∩≥σφ±σΩ±απΦφ≥ΦδδΦεφ',
- 207 => 'εΩ≥ε±σΩ±απΦφ≥ΦδδΦεφ',
- 210 => 'φεΓσ∞±σΩ±απΦφ≥ΦδδΦεφ',
- 213 => '±σ∩≥απΦφ≥ΦδδΦεφ',
- 216 => '≤φ±σ∩≥απΦφ≥ΦδδΦεφ',
- 219 => 'Σ≤ε±σ∩≥απΦφ≥ΦδδΦεφ',
- 222 => '≥≡σ±σ∩≥απΦφ≥ΦδδΦεφ',
- 225 => 'ΩΓα≥ε≡±σ∩≥απΦφ≥ΦδδΦεφ',
- 228 => 'ΩΓΦφ±σ∩≥απΦφ≥ΦδδΦεφ',
- 231 => '±σΩ±±σ∩≥απΦφ≥ΦδδΦεφ',
- 234 => '±σ∩≥σφ±σ∩≥απΦφ≥ΦδδΦεφ',
- 237 => 'εΩ≥ε±σ∩≥απΦφ≥ΦδδΦεφ',
- 240 => 'φεΓσ∞±σ∩≥απΦφ≥ΦδδΦεφ',
- 243 => 'εΩ≥επΦφ≥ΦδδΦεφ',
- 246 => '≤φεΩ≥επΦφ≥ΦδδΦεφ',
- 249 => 'Σ≤εεΩ≥επΦφ≥ΦδδΦεφ',
- 252 => '≥≡σεΩ≥επΦφ≥ΦδδΦεφ',
- 255 => 'ΩΓα≥ε≡εΩ≥επΦφ≥ΦδδΦεφ',
- 258 => 'ΩΓΦφεΩ≥επΦφ≥ΦδδΦεφ',
- 261 => '±σΩ±εΩ≥επΦφ≥ΦδδΦεφ',
- 264 => '±σ∩≥εΩ≥επΦφ≥ΦδδΦεφ',
- 267 => 'εΩ≥εεΩ≥επΦφ≥ΦδδΦεφ',
- 270 => 'φεΓσ∞εΩ≥επΦφ≥ΦδδΦεφ',
- 273 => 'φεφαπΦφ≥ΦδδΦεφ',
- 276 => '≤φφεφαπΦφ≥ΦδδΦεφ',
- 279 => 'Σ≤εφεφαπΦφ≥ΦδδΦεφ',
- 282 => '≥≡σφεφαπΦφ≥ΦδδΦεφ',
- 285 => 'ΩΓα≥ε≡φεφαπΦφ≥ΦδδΦεφ',
- 288 => 'ΩΓΦφφεφαπΦφ≥ΦδδΦεφ',
- 291 => '±σΩ±φεφαπΦφ≥ΦδδΦεφ',
- 294 => '±σ∩≥σφφεφαπΦφ≥ΦδδΦεφ',
- 297 => 'εΩ≥εφεφαπΦφ≥ΦδδΦεφ',
- 300 => 'φεΓσ∞φεφαπΦφ≥ΦδδΦεφ',
- 303 => '÷σφ≥ΦδδΦεφ'
- );
-
- /**
- * The array containing the teens' :) names
- * @var array
- * @access private
- */
- var $_teens = array(
- 11=>'εΣΦφφαΣ÷α≥ⁿ',
- 12=>'ΣΓσφαΣ÷α≥ⁿ',
- 13=>'≥≡ΦφαΣ÷α≥ⁿ',
- 14=>'≈σ≥√≡φαΣ÷α≥ⁿ',
- 15=>'∩ ≥φαΣ÷α≥ⁿ',
- 16=>'°σ±≥φαΣ÷α≥ⁿ',
- 17=>'±σ∞φαΣ÷α≥ⁿ',
- 18=>'Γε±σ∞φαΣ÷α≥ⁿ',
- 19=>'ΣσΓ ≥φαΣ÷α≥ⁿ'
- );
-
- /**
- * The array containing the tens' names
- * @var array
- * @access private
- */
- var $_tens = array(
- 2=>'ΣΓαΣ÷α≥ⁿ',
- 3=>'≥≡ΦΣ÷α≥ⁿ',
- 4=>'±ε≡εΩ',
- 5=>'∩ ≥ⁿΣσ± ≥',
- 6=>'°σ±≥ⁿΣσ± ≥',
- 7=>'±σ∞ⁿΣσ± ≥',
- 8=>'Γε±σ∞ⁿΣσ± ≥',
- 9=>'ΣσΓ φε±≥ε'
- );
-
- /**
- * The array containing the hundreds' names
- * @var array
- * @access private
- */
- var $_hundreds = array(
- 1=>'±≥ε',
- 2=>'ΣΓσ±≥Φ',
- 3=>'≥≡Φ±≥α',
- 4=>'≈σ≥√≡σ±≥α',
- 5=>'∩ ≥ⁿ±ε≥',
- 6=>'°σ±≥ⁿ±ε≥',
- 7=>'±σ∞ⁿ±ε≥',
- 8=>'Γε±σ∞ⁿ±ε≥',
- 9=>'ΣσΓ ≥ⁿ±ε≥'
- );
-
- /**
- * The array containing the digits
- * for neutral, male and female
- * @var array
- * @access private
- */
- var $_digits = array(
- array('φεδⁿ', 'εΣφε', 'ΣΓα', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ'),
- array('φεδⁿ', 'εΣΦφ', 'ΣΓα', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ'),
- array('φεδⁿ', 'εΣφα', 'ΣΓσ', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ')
- );
-
- /**
- * The word separator
- * @var string
- * @access private
- */
- var $_sep = ' ';
-
- /**
- * The currency names (based on the below links,
- * informations from central bank websites and on encyclopedias)
- *
- * @var array
- * @link http://www.jhall.demon.co.uk/currency/by_abbrev.html World currencies
- * @link http://www.rusimpex.ru/Content/Reference/Refinfo/valuta.htm Foreign currencies names
- * @link http://www.cofe.ru/Finance/money.asp Currencies names
- * @access private
- */
- var $_currency_names = array(
- 'ALL' => array(
- array(1,'δσΩ','δσΩα','δσΩεΓ'),
- array(2,'ΩΦφΣα≡Ωα','ΩΦφΣα≡ΩΦ','ΩΦφΣα≡εΩ')
- ),
- 'AUD' => array(
- array(1,'αΓ±≥≡αδΦΘ±ΩΦΘ Σεδδα≡','αΓ±≥≡αδΦΘ±ΩΦ⌡ Σεδδα≡α','αΓ±≥≡αδΦΘ±ΩΦ⌡ Σεδδα≡εΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'BGN' => array(
- array(1,'δσΓ','δσΓα','δσΓεΓ'),
- array(2,'±≥ε≥ΦφΩα','±≥ε≥ΦφΩΦ','±≥ε≥ΦφεΩ')
- ),
- 'BRL' => array(
- array(1,'ß≡ατΦδⁿ±ΩΦΘ ≡σαδ','ß≡ατΦδⁿ±ΩΦ⌡ ≡σαδα','ß≡ατΦδⁿ±ΩΦ⌡ ≡σαδεΓ'),
- array(1,'±σφ≥αΓε','±σφ≥αΓε','±σφ≥αΓε')
- ),
- 'BYR' => array(
- array(1,'ßσδε≡≤±±ΩΦΘ ≡≤ßδⁿ','ßσδε≡≤±±ΩΦ⌡ ≡≤ßδ ','ßσδε≡≤±±ΩΦ⌡ ≡≤ßδσΘ'),
- array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
- ),
- 'CAD' => array(
- array(1,'ΩαφαΣ±ΩΦΘ Σεδδα≡','ΩαφαΣ±ΩΦ⌡ Σεδδα≡α','ΩαφαΣ±ΩΦ⌡ Σεδδα≡εΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'CHF' => array(
- array(1,'°ΓσΘ÷α≡±ΩΦΘ ⌠≡αφΩ','°ΓσΘ÷α≡±ΩΦ⌡ ⌠≡αφΩα','°ΓσΘ÷α≡±ΩΦ⌡ ⌠≡αφΩεΓ'),
- array(1,'±αφ≥Φ∞','±αφ≥Φ∞α','±αφ≥Φ∞εΓ')
- ),
- 'CYP' => array(
- array(1,'ΩΦ∩≡±ΩΦΘ ⌠≤φ≥','ΩΦ∩≡±ΩΦ⌡ ⌠≤φ≥α','ΩΦ∩≡±ΩΦ⌡ ⌠≤φ≥εΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'CZK' => array(
- array(2,'≈σ°±Ωα Ω≡εφα','≈σ°±ΩΦ⌡ Ω≡εφ√','≈σ°±ΩΦ⌡ Ω≡εφ'),
- array(1,'παδΦ≡µ','παδΦ≡µα','παδΦ≡µσΘ')
- ),
- 'DKK' => array(
- array(2,'Σα≥±Ωα Ω≡εφα','Σα≥±ΩΦ⌡ Ω≡εφ√','Σα≥±ΩΦ⌡ Ω≡εφ'),
- array(1,'²≡σ','²≡σ','²≡σ')
- ),
- 'EEK' => array(
- array(2,'²±≥εφ±Ωα Ω≡εφα','²±≥εφ±ΩΦ⌡ Ω≡εφ√','²±≥εφ±ΩΦ⌡ Ω≡εφ'),
- array(1,'±σφ≥Φ','±σφ≥Φ','±σφ≥Φ')
- ),
- 'EUR' => array(
- array(1,'σΓ≡ε','σΓ≡ε','σΓ≡ε'),
- array(1,'σΓ≡ε÷σφ≥','σΓ≡ε÷σφ≥α','σΓ≡ε÷σφ≥εΓ')
- ),
- 'CYP' => array(
- array(1,'⌠≤φ≥ ±≥σ≡δΦφπεΓ','⌠≤φ≥α ±≥σ≡δΦφπεΓ','⌠≤φ≥εΓ ±≥σ≡δΦφπεΓ'),
- array(1,'∩σφ±','∩σφ±α','∩σφ±εΓ')
- ),
- 'CAD' => array(
- array(1,'πεφΩεφπ±ΩΦΘ Σεδδα≡','πεφΩεφπ±ΩΦ⌡ Σεδδα≡α','πεφΩεφπ±ΩΦ⌡ Σεδδα≡εΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'HRK' => array(
- array(2,'⌡ε≡Γα≥±Ωα Ω≤φα','⌡ε≡Γα≥±ΩΦ⌡ Ω≤φ√','⌡ε≡Γα≥±ΩΦ⌡ Ω≤φ'),
- array(2,'δΦ∩α','δΦ∩√','δΦ∩')
- ),
- 'HUF' => array(
- array(1,'Γσφπσ≡±ΩΦΘ ⌠ε≡Φφ≥','Γσφπσ≡±ΩΦ⌡ ⌠ε≡Φφ≥α','Γσφπσ≡±ΩΦ⌡ ⌠ε≡Φφ≥εΓ'),
- array(1,'⌠Φδδσ≡','⌠Φδδσ≡α','⌠Φδδσ≡εΓ')
- ),
- 'ISK' => array(
- array(2,'Φ±δαφΣ±Ωα Ω≡εφα','Φ±δαφΣ±ΩΦ⌡ Ω≡εφ√','Φ±δαφΣ±ΩΦ⌡ Ω≡εφ'),
- array(1,'²≡σ','²≡σ','²≡σ')
- ),
- 'JPY' => array(
- array(2,'Φσφα','Φσφ√','Φσφ'),
- array(2,'±σφα','±σφ√','±σφ')
- ),
- 'LTL' => array(
- array(1,'δΦ≥','δΦ≥α','δΦ≥εΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'LVL' => array(
- array(1,'δα≥','δα≥α','δα≥εΓ'),
- array(1,'±σφ≥Φ∞','±σφ≥Φ∞α','±σφ≥Φ∞εΓ')
- ),
- 'MKD' => array(
- array(1,'∞αΩσΣεφ±ΩΦΘ ΣΦφα≡','∞αΩσΣεφ±ΩΦ⌡ ΣΦφα≡α','∞αΩσΣεφ±ΩΦ⌡ ΣΦφα≡εΓ'),
- array(1,'ΣσφΦ','ΣσφΦ','ΣσφΦ')
- ),
- 'MTL' => array(
- array(2,'∞αδⁿ≥ΦΘ±Ωα δΦ≡α','∞αδⁿ≥ΦΘ±ΩΦ⌡ δΦ≡√','∞αδⁿ≥ΦΘ±ΩΦ⌡ δΦ≡'),
- array(1,'±σφ≥Φ∞','±σφ≥Φ∞α','±σφ≥Φ∞εΓ')
- ),
- 'NOK' => array(
- array(2,'φε≡Γσµ±Ωα Ω≡εφα','φε≡Γσµ±ΩΦ⌡ Ω≡εφ√','φε≡Γσµ±ΩΦ⌡ Ω≡εφ'),
- array(0,'²≡σ','²≡σ','²≡σ')
- ),
- 'PLN' => array(
- array(1,'τδε≥√Θ','τδε≥√⌡','τδε≥√⌡'),
- array(1,'π≡ε°','π≡ε°α','π≡ε°σΘ')
- ),
- 'ROL' => array(
- array(1,'≡≤∞√φ±ΩΦΘ δσΘ','≡≤∞√φ±ΩΦ⌡ δσΘ','≡≤∞√φ±ΩΦ⌡ δσΘ'),
- array(1,'ßαφΦ','ßαφΦ','ßαφΦ')
- ),
- // both RUR and RUR are used, I use RUB for shorter form
- 'RUB' => array(
- array(1,'≡≤ßδⁿ','≡≤ßδ ','≡≤ßδσΘ'),
- array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
- ),
- 'RUR' => array(
- array(1,'≡ε±±ΦΘ±ΩΦΘ ≡≤ßδⁿ','≡ε±±ΦΘ±ΩΦ⌡ ≡≤ßδ ','≡ε±±ΦΘ±ΩΦ⌡ ≡≤ßδσΘ'),
- array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
- ),
- 'SEK' => array(
- array(2,'°ΓσΣ±Ωα Ω≡εφα','°ΓσΣ±ΩΦ⌡ Ω≡εφ√','°ΓσΣ±ΩΦ⌡ Ω≡εφ'),
- array(1,'²≡σ','²≡σ','²≡σ')
- ),
- 'SIT' => array(
- array(1,'±δεΓσφ±ΩΦΘ ≥εδα≡','±δεΓσφ±ΩΦ⌡ ≥εδα≡α','±δεΓσφ±ΩΦ⌡ ≥εδα≡εΓ'),
- array(2,'±≥ε≥Φφα','±≥ε≥Φφ√','±≥ε≥Φφ')
- ),
- 'SKK' => array(
- array(2,'±δεΓα÷Ωα Ω≡εφα','±δεΓα÷ΩΦ⌡ Ω≡εφ√','±δεΓα÷ΩΦ⌡ Ω≡εφ'),
- array(0,'','','')
- ),
- 'TRL' => array(
- array(2,'≥≤≡σ÷Ωα δΦ≡α','≥≤≡σ÷ΩΦ⌡ δΦ≡√','≥≤≡σ÷ΩΦ⌡ δΦ≡'),
- array(1,'∩Φα±≥≡','∩Φα±≥≡α','∩Φα±≥≡εΓ')
- ),
- 'UAH' => array(
- array(2,'π≡ΦΓφα','π≡ΦΓφ√','π≡ΦΓσφ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'USD' => array(
- array(1,'Σεδδα≡ ╤╪└','Σεδδα≡α ╤╪└','Σεδδα≡εΓ ╤╪└'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- ),
- 'YUM' => array(
- array(1,'■πε±δαΓ±ΩΦΘ ΣΦφα≡','■πε±δαΓ±ΩΦ⌡ ΣΦφα≡α','■πε±δαΓ±ΩΦ⌡ ΣΦφα≡εΓ'),
- array(1,'∩α≡α','∩α≡α','∩α≡α')
- ),
- 'ZAR' => array(
- array(1,'≡αφΣ','≡αφΣα','≡αφΣεΓ'),
- array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
- )
- );
-
- /**
- * The default currency name
- * @var string
- * @access public
- */
- var $def_currency = 'RUB'; // Russian rouble
-
- // }}}
- // {{{ toWords()
-
- /**
- * Converts a number to its word representation
- * in Russian language
- *
- * @param integer $num An integer between -infinity and infinity inclusive :)
- * that need to be converted to words
- * @param integer $gender Gender of string, 0=neutral, 1=male, 2=female.
- * Optional, defaults to 1.
- *
- * @return string The corresponding word representation
- *
- * @access private
- * @author Andrey Demenev <demenev@on-line.jar.ru>
- */
- function toWords($num, $gender = 1)
- {
- return $this->_toWordsWithCase($num, $dummy, $gender);
- }
-
- /**
- * Converts a number to its word representation
- * in Russian language and determines the case of string.
- *
- * @param integer $num An integer between -infinity and infinity inclusive :)
- * that need to be converted to words
- * @param integer $case A variable passed by reference which is set to case
- * of the word associated with the number
- * @param integer $gender Gender of string, 0=neutral, 1=male, 2=female.
- * Optional, defaults to 1.
- *
- * @return string The corresponding word representation
- *
- * @access private
- * @author Andrey Demenev <demenev@on-line.jar.ru>
- */
- function _toWordsWithCase($num, &$case, $gender = 1)
- {
- $ret = '';
- $case = 3;
-
- $num = trim($num);
-
- $sign = "";
- if (substr($num, 0, 1) == '-') {
- $sign = $this->_minus . $this->_sep;
- $num = substr($num, 1);
- }
-
- while (strlen($num) % 3) $num = '0' . $num;
- if ($num == 0 || $num == '') {
- $ret .= $this->_digits[$gender][0];
- }
-
- else {
- $power = 0;
- while ($power < strlen($num)) {
- if (!$power) {
- $groupgender = $gender;
- } elseif ($power == 3) {
- $groupgender = 2;
- } else {
- $groupgender = 1;
- }
- $group = $this->_groupToWords(substr($num,-$power-3,3),$groupgender,$_case);
- if (!$power) {
- $case = $_case;
- }
- if ($power == 3) {
- if ($_case == 1) {
- $group .= $this->_sep . '≥√± ≈α';
- } elseif ($_case == 2) {
- $group .= $this->_sep . '≥√± ≈Φ';
- } else {
- $group .= $this->_sep . '≥√± ≈';
- }
- } elseif ($group && $power>3 && isset($this->_exponent[$power])) {
- $group .= $this->_sep . $this->_exponent[$power];
- if ($_case == 2) {
- $group .= 'α';
- } elseif ($_case == 3) {
- $group .= 'εΓ';
- }
- }
- if ($group) {
- $ret = $group . $this->_sep . $ret;
- }
- $power+=3;
- }
- }
-
- return $sign . $ret;
- }
-
- // }}}
- // {{{ _groupToWords()
-
- /**
- * Converts a group of 3 digits to its word representation
- * in Russian language.
- *
- * @param integer $num An integer between -infinity and infinity inclusive :)
- * that need to be converted to words
- * @param integer $gender Gender of string, 0=neutral, 1=male, 2=female.
- * @param integer $case A variable passed by reference which is set to case
- * of the word associated with the number
- *
- * @return string The corresponding word representation
- *
- * @access private
- * @author Andrey Demenev <demenev@on-line.jar.ru>
- */
- function _groupToWords($num, $gender, &$case)
- {
- $ret = '';
- $case = 3;
- if ((int)$num == 0) {
- $ret = '';
- } elseif ($num < 10) {
- $ret = $this->_digits[$gender][(int)$num];
- if ($num == 1) $case = 1;
- elseif ($num < 5) $case = 2;
- else $case = 3;
- } else {
- $num = str_pad($num,3,'0',STR_PAD_LEFT);
- $hundreds = (int)$num{0};
- if ($hundreds) {
- $ret = $this->_hundreds[$hundreds];
- if (substr($num,1) != '00') {
- $ret .= $this->_sep;
- }
- $case = 3;
- }
- $tens=(int)$num{1};
- $ones=(int)$num{2};
- if ($tens || $ones) {
- if ($tens == 1 && $ones == 0) $ret .= 'Σσ± ≥ⁿ';
- elseif ($tens == 1) $ret .= $this->_teens[$ones+10];
- else {
- if ($tens > 0) {
- $ret .= $this->_tens[(int)$tens];
- }
- if ($ones > 0) {
- $ret .= $this->_sep
- .$this->_digits[$gender][$ones];
- if ($ones == 1) {
- $case = 1;
- } elseif ($ones < 5) {
- $case = 2;
- } else {
- $case = 3;
- }
- }
- }
- }
- }
- return $ret;
- }
- // }}}
- // {{{ toCurrencyWords()
-
- /**
- * Converts a currency value to its word representation
- * (with monetary units) in Russian language
- *
- * @param integer $int_curr An international currency symbol
- * as defined by the ISO 4217 standard (three characters)
- * @param integer $decimal A money total amount without fraction part (e.g. amount of dollars)
- * @param integer $fraction Fractional part of the money amount (e.g. amount of cents)
- * Optional. Defaults to false.
- * @param integer $convert_fraction Convert fraction to words (left as numeric if set to false).
- * Optional. Defaults to true.
- *
- * @return string The corresponding word representation for the currency
- *
- * @access public
- * @author Andrey Demenev <demenev@on-line.jar.ru>
- */
- function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true)
- {
- $int_curr = strtoupper($int_curr);
- if (!isset($this->_currency_names[$int_curr])) {
- $int_curr = $this->def_currency;
- }
- $curr_names = $this->_currency_names[$int_curr];
- $ret = trim($this->_toWordsWithCase($decimal, $case, $curr_names[0][0]));
- $ret .= $this->_sep . $curr_names[0][$case];
-
- if ($fraction !== false) {
- if ($convert_fraction) {
- $ret .= $this->_sep . trim($this->_toWordsWithCase($fraction, $case, $curr_names[1][0]));
- } else {
- $ret .= $this->_sep . $fraction;
- }
- $ret .= $this->_sep . $curr_names[1][$case];
- }
- return $ret;
- }
- // }}}
-
- }
-
- ?>
-