Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/erp/htdocs/custom/numberwords/includes/Numbers/Words/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/erp/htdocs/custom/numberwords/includes/Numbers/Words/lang.pl.php
<?php
/**
 * Numbers_Words
 *
 * PHP version 4
 *
 * Copyright (c) 1997-2006 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.
 *
 * @category Numbers
 * @package  Numbers_Words
 * @author   Piotr Klaban <makler@man.torun.pl>
 * @license  PHP 3.0 http://www.php.net/license/3_0.txt
 * @version  SVN: $Id: lang.pl.php 302816 2010-08-26 16:02:29Z ifeghali $
 * @link     http://pear.php.net/package/Numbers_Words
 */

/**
 * Class for translating numbers into Polish.
 *
 * @author Piotr Klaban
 * @package Numbers_Words
 */

/**
 * Include needed files
 */
require_once "Numbers/Words.php";

/**
 * Class for translating numbers into Polish.
 *
 * @category Numbers
 * @package  Numbers_Words
 * @author   Piotr Klaban <makler@man.torun.pl>
 * @license  PHP 3.0 http://www.php.net/license/3_0.txt
 * @link     http://pear.php.net/package/Numbers_Words
 */
class Numbers_Words_pl extends Numbers_Words
{

	// {{{ properties

	/**
	 * Locale name
	 * @var string
	 * @access public
	 */
	var $locale = 'pl';

	/**
	 * Language name in English
	 * @var string
	 * @access public
	 */
	var $lang = 'Polish';

	/**
	 * Native language name
	 * @var string
	 * @access public
	 */
	var $lang_native = 'polski';

	/**
	 * The word for the minus sign
	 * @var string
	 * @access private
	 */
	var $_minus = 'minus'; // minus sign

	/**
	 * The sufixes for exponents (singular and plural)
	 * Names based on:
	 * mathematical tables, my memory, and also:
	 * http://ux1.math.us.edu.pl/~szyjewski/FAQ/liczby/iony.htm
	 * @var array
	 * @access private
	 */
	var $_exponent = array(
	   // pot锚ga dziesi卤tki => liczba pojedyncza, podw贸jna, mnoga
		0 => array('','',''),
		3 => array('tysi卤c','tysi卤ce','tysi锚cy'),
		6 => array('milion','miliony','milion贸w'),
		9 => array('miliard','miliardy','miliard贸w'),
	   12 => array('bilion','biliony','bilion贸w'),
	   15 => array('biliard','biliardy','biliard贸w'),
	   18 => array('trylion','tryliony','trylion贸w'),
	   21 => array('tryliard','tryliardy','tryliard贸w'),
	   24 => array('kwadrylion','kwadryliony','kwadrylion贸w'),
	   27 => array('kwadryliard','kwadryliardy','kwadryliard贸w'),
	   30 => array('kwintylion','kwintyliony','kwintylion贸w'),
	   33 => array('kwintyliiard','kwintyliardy','kwintyliard贸w'),
	   36 => array('sekstylion','sekstyliony','sekstylion贸w'),
	   39 => array('sekstyliard','sekstyliardy','sekstyliard贸w'),
	   42 => array('septylion','septyliony','septylion贸w'),
	   45 => array('septyliard','septyliardy','septyliard贸w'),
	   48 => array('oktylion','oktyliony','oktylion贸w'),
	   51 => array('oktyliard','oktyliardy','oktyliard贸w'),
	   54 => array('nonylion','nonyliony','nonylion贸w'),
	   57 => array('nonyliard','nonyliardy','nonyliard贸w'),
	   60 => array('decylion','decyliony','decylion贸w'),
	   63 => array('decyliard','decyliardy','decyliard贸w'),
	  100 => array('centylion','centyliony','centylion贸w'),
	  103 => array('centyliard','centyliardy','centyliard贸w'),
	  120 => array('wicylion','wicylion','wicylion'),
	  123 => array('wicyliard','wicyliardy','wicyliard贸w'),
	  180 => array('trycylion','trycylion','trycylion'),
	  183 => array('trycyliard','trycyliardy','trycyliard贸w'),
	  240 => array('kwadragilion','kwadragilion','kwadragilion'),
	  243 => array('kwadragiliard','kwadragiliardy','kwadragiliard贸w'),
	  300 => array('kwinkwagilion','kwinkwagilion','kwinkwagilion'),
	  303 => array('kwinkwagiliard','kwinkwagiliardy','kwinkwagiliard贸w'),
	  360 => array('seskwilion','seskwilion','seskwilion'),
	  363 => array('seskwiliard','seskwiliardy','seskwiliard贸w'),
	  420 => array('septagilion','septagilion','septagilion'),
	  423 => array('septagiliard','septagiliardy','septagiliard贸w'),
	  480 => array('oktogilion','oktogilion','oktogilion'),
	  483 => array('oktogiliard','oktogiliardy','oktogiliard贸w'),
	  540 => array('nonagilion','nonagilion','nonagilion'),
	  543 => array('nonagiliard','nonagiliardy','nonagiliard贸w'),
	  600 => array('centylion','centyliony','centylion贸w'),
	  603 => array('centyliard','centyliardy','centyliard贸w'),
	  6000018 => array('milinilitrylion','milinilitryliony','milinilitrylion贸w')
		);

	/**
	 * The array containing the digits (indexed by the digits themselves).
	 * @var array
	 * @access private
	 */
	var $_digits = array(
		0 => 'zero', 'jeden', 'dwa', 'trzy', 'cztery',
		'pi锚忙', 'sze露忙', 'siedem', 'osiem', 'dziewi锚忙'
	);

	/**
	 * 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.xe.com/iso4217.htm Currency codes
	 * @link http://www.republika.pl/geographia/peuropy.htm Europe review
	 * @link http://pieniadz.hoga.pl/waluty_objasnienia.asp Currency service
	 * @access private
	 */
	var $_currency_names = array(
	  'ALL' => array(array('lek','leki','lek贸w'), array('quindarka','quindarki','quindarek')),
	  'AUD' => array(array('dolar australijski', 'dolary australijskie', 'dolar贸w australijskich'), array('cent', 'centy', 'cent贸w')),
	  'BAM' => array(array('marka','marki','marek'), array('fenig','fenigi','fenig贸w')),
	  'BGN' => array(array('lew','lewy','lew'), array('stotinka','stotinki','stotinek')),
	  'BRL' => array(array('real','reale','real贸w'), array('centavos','centavos','centavos')),
	  'BYR' => array(array('rubel','ruble','rubli'), array('kopiejka','kopiejki','kopiejek')),
	  'CAD' => array(array('dolar kanadyjski', 'dolary kanadyjskie', 'dolar贸w kanadyjskich'), array('cent', 'centy', 'cent贸w')),
	  'CHF' => array(array('frank szwajcarski','franki szwajcarskie','frank贸w szwajcarskich'), array('rapp','rappy','rapp贸w')),
	  'CYP' => array(array('funt cypryjski','funty cypryjskie','funt贸w cypryjskich'), array('cent', 'centy', 'cent贸w')),
	  'CZK' => array(array('korona czeska','korony czeskie','koron czeskich'), array('halerz','halerze','halerzy')),
	  'DKK' => array(array('korona du帽ska','korony du帽skie','koron du帽skich'), array('ore','ore','ore')),
	  'EEK' => array(array('korona esto帽ska','korony esto帽skie','koron esto帽skich'), array('senti','senti','senti')),
	  'EUR' => array(array('euro', 'euro', 'euro'), array('eurocent', 'eurocenty', 'eurocent贸w')),
	  'GBP' => array(array('funt szterling','funty szterlingi','funt贸w szterling贸w'), array('pens','pensy','pens贸w')),
	  'HKD' => array(array('dolar Hongkongu','dolary Hongkongu','dolar贸w Hongkongu'), array('cent', 'centy', 'cent贸w')),
	  'HRK' => array(array('kuna','kuny','kun'), array('lipa','lipy','lip')),
	  'HUF' => array(array('forint','forinty','forint贸w'), array('filler','fillery','filler贸w')),
	  'ILS' => array(array('nowy szekel','nowe szekele','nowych szekeli'), array('agora','agory','agorot')),
	  'ISK' => array(array('korona islandzka','korony islandzkie','koron islandzkich'), array('aurar','aurar','aurar')),
	  'JPY' => array(array('jen','jeny','jen贸w'), array('sen','seny','sen贸w')),
	  'LTL' => array(array('lit','lity','lit贸w'), array('cent', 'centy', 'cent贸w')),
	  'LVL' => array(array('鲁at','鲁aty','鲁at贸w'), array('sentim','sentimy','sentim贸w')),
	  'MKD' => array(array('denar','denary','denar贸w'), array('deni','deni','deni')),
	  'MTL' => array(array('lira malta帽ska','liry malta帽skie','lir malta帽skich'), array('centym','centymy','centym贸w')),
	  'NOK' => array(array('korona norweska','korony norweskie','koron norweskich'), array('oere','oere','oere')),
	  'PLN' => array(array('z鲁oty', 'z鲁ote', 'z鲁otych'), array('grosz', 'grosze', 'groszy')),
	  'ROL' => array(array('lej','leje','lei'), array('bani','bani','bani')),
	  'RUB' => array(array('rubel','ruble','rubli'), array('kopiejka','kopiejki','kopiejek')),
	  'SEK' => array(array('korona szwedzka','korony szwedzkie','koron szweckich'), array('oere','oere','oere')),
	  'SIT' => array(array('tolar','tolary','tolar贸w'), array('stotinia','stotinie','stotini')),
	  'SKK' => array(array('korona s鲁owacka','korony s鲁owackie','koron s鲁owackich'), array('halerz','halerze','halerzy')),
	  'TRL' => array(array('lira turecka','liry tureckie','lir tureckich'), array('kurusza','kurysze','kuruszy')),
	  'UAH' => array(array('hrywna','hrywna','hrywna'), array('cent', 'centy', 'cent贸w')),
	  'USD' => array(array('dolar','dolary','dolar贸w'), array('cent', 'centy', 'cent贸w')),
	  'YUM' => array(array('dinar','dinary','dinar贸w'), array('para','para','para')),
	  'ZAR' => array(array('rand','randy','rand贸w'), array('cent', 'centy', 'cent贸w'))
	);

	/**
	 * The default currency name
	 * @var string
	 * @access public
	 */
	var $def_currency = 'PLN'; // Polish zloty

	// }}}
	// {{{ _toWords()

	/**
	 * Converts a number to its word representation
	 * in Polish language
	 *
	 * @param integer $num       An integer between -infinity and infinity inclusive :)
	 *                           that need to be converted to words
	 * @param integer $power     The power of ten for the rest of the number to the right.
	 *                           Optional, defaults to 0.
	 * @param integer $powsuffix The power name to be added to the end of the return string.
	 *                           Used internally. Optional, defaults to ''.
	 *
	 * @return string  The corresponding word representation
	 *
	 * @access protected
	 * @author Piotr Klaban <makler@man.torun.pl>
	 * @since  Numbers_Words 0.16.3
	 */
	function _toWords($num, $power = 0, $powsuffix = '')
	{
		$ret = '';

		// add a minus sign
		if (substr($num, 0, 1) == '-') {
			$ret = $this->_sep . $this->_minus;
			$num = substr($num, 1);
		}

		// strip excessive zero signs and spaces
		$num = trim($num);
		$num = preg_replace('/^0+/', '', $num);

		if (strlen($num) > 3) {
			$maxp = strlen($num)-1;
			$curp = $maxp;
			for ($p = $maxp; $p > 0; --$p) { // power
				// check for highest power
				if (isset($this->_exponent[$p])) {
					// send substr from $curp to $p
					$snum = substr($num, $maxp - $curp, $curp - $p + 1);
					$snum = preg_replace('/^0+/', '', $snum);
					if ($snum !== '') {
						$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
						if ($powsuffix != '') {
							$cursuffix .= $this->_sep . $powsuffix;
						}

						$ret .= $this->_toWords($snum, $p, $cursuffix);
					}
					$curp = $p - 1;
					continue;
				}
			}
			$num = substr($num, $maxp - $curp, $curp - $p + 1);
			if ($num == 0) {
				return $ret;
			}
		} elseif ($num == 0 || $num == '') {
			return $this->_sep . $this->_digits[0];
		}

		$h = $t = $d = 0;

		switch (strlen($num)) {
			case 3:
				$h = (int) substr($num, -3, 1);

			case 2:
				$t = (int) substr($num, -2, 1);

			case 1:
				$d = (int) substr($num, -1, 1);
			break;

			case 0:
			return;
			break;
		}

		switch ($h) {
			case 9:
				$ret .= $this->_sep . 'dziewi锚忙set';
			break;

			case 8:
				$ret .= $this->_sep . 'osiemset';
			break;

			case 7:
				$ret .= $this->_sep . 'siedemset';
			break;

			case 6:
				$ret .= $this->_sep . 'sze露忙set';
			break;

			case 5:
				$ret .= $this->_sep . 'pi锚忙set';
			break;

			case 4:
				$ret .= $this->_sep . 'czterysta';
			break;

			case 3:
				$ret .= $this->_sep . 'trzysta';
			break;

			case 2:
				$ret .= $this->_sep . 'dwie露cie';
			break;

			case 1:
				$ret .= $this->_sep . 'sto';
			break;
		}

		switch ($t) {
			case 9:
			case 8:
			case 7:
			case 6:
			case 5:
				$ret .= $this->_sep . $this->_digits[$t] . 'dziesi卤t';
			break;

			case 4:
				$ret .= $this->_sep . 'czterdzie露ci';
			break;

			case 3:
				$ret .= $this->_sep . 'trzydzie露ci';
			break;

			case 2:
				$ret .= $this->_sep . 'dwadzie露cia';
			break;

			case 1:
				switch ($d) {
					case 0:
						$ret .= $this->_sep . 'dziesi锚忙';
					break;

					case 1:
						$ret .= $this->_sep . 'jedena露cie';
					break;

					case 2:
					case 3:
					case 7:
					case 8:
						$ret .= $this->_sep . $this->_digits[$d] . 'na露cie';
					break;

					case 4:
						$ret .= $this->_sep . 'czterna露cie';
					break;

					case 5:
						$ret .= $this->_sep . 'pi锚tna露cie';
					break;

					case 6:
						$ret .= $this->_sep . 'szesna露cie';
					break;

					case 9:
						$ret .= $this->_sep . 'dziewi锚tna露cie';
					break;
				}
			break;
		}

		if ($t != 1 && $d > 0) {
			$ret .= $this->_sep . $this->_digits[$d];
		}

		if ($t == 1) {
			$d = 0;
		}

		if (( $h + $t ) > 0 && $d == 1) {
			$d = 0;
		}

		if ($power > 0) {
			if (isset($this->_exponent[$power])) {
				$lev = $this->_exponent[$power];
			}

			if (!isset($lev) || !is_array($lev)) {
				return null;
			}

			switch ($d) {
				case 1:
					$suf = $lev[0];
				break;
				case 2:
				case 3:
				case 4:
					$suf = $lev[1];
				break;
				case 0:
				case 5:
				case 6:
				case 7:
				case 8:
				case 9:
					$suf = $lev[2];
				break;
			}

			$ret .= $this->_sep . $suf;
		}

		if ($powsuffix != '') {
			$ret .= $this->_sep . $powsuffix;
		}

		return $ret;
	}
	// }}}
	// {{{ toCurrencyWords()

	/**
	 * Converts a currency value to its word representation
	 * (with monetary units) in Polish 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 Piotr Klaban <makler@man.torun.pl>
	 * @since  Numbers_Words 0.4
	 */
	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->_toWords($decimal));
		$lev  = $this->_get_numlevel($decimal);
		$ret .= $this->_sep . $curr_names[0][$lev];

		if ($fraction !== false) {
			if ($convert_fraction) {
				$ret .= $this->_sep . trim($this->_toWords($fraction));
			} else {
				$ret .= $this->_sep . $fraction;
			}
			$lev  = $this->_get_numlevel($fraction);
			$ret .= $this->_sep . $curr_names[1][$lev];
		}

		return $ret;
	}
	// }}}
	// {{{ _get_numlevel()

	/**
	 * Returns grammatical "level" of the number - this is necessary
	 * for choosing the right suffix for exponents and currency names.
	 *
	 * @param integer $num An integer between -infinity and infinity inclusive
	 *                     that need to be converted to words
	 *
	 * @return integer  The grammatical "level" of the number.
	 *
	 * @access private
	 * @author Piotr Klaban <makler@man.torun.pl>
	 * @since  Numbers_Words 0.4
	 */
	function _get_numlevel($num)
	{
		if (strlen($num) > 3) {
			$num = substr($num, -3);
		}
		$num = (int) $num;

		$h = $t = $d = $lev = 0;

		switch (strlen($num)) {
			case 3:
				$h = (int) substr($num, -3, 1);

			case 2:
				$t = (int) substr($num, -2, 1);

			case 1:
				$d = (int) substr($num, -1, 1);
			break;

			case 0:
			return $lev;
			break;
		}

		if ($t == 1) {
			$d = 0;
		}

		if (( $h + $t ) > 0 && $d == 1) {
			$d = 0;
		}

		switch ($d) {
			case 1:
				$lev = 0;
			break;
			case 2:
			case 3:
			case 4:
				$lev = 1;
			break;
			default:
				$lev = 2;
		}
		return $lev;
	}
	// }}}
}

Hry