Source for file lang.id.php
Documentation is available at lang.id.php
/* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2001 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: Ernas M. Jamil <ernasm@samba.co.id>, Arif Rifai Dwiyanto |
// +----------------------------------------------------------------------+
// $Id: lang.en_GB.php,v 1.3 2002/11/26 10:33:35 makler Exp $
// Numbers_Words class extension to spell numbers in Indonesian language.
require_once("PEAR.php");
require_once("Numbers/Words.php");
* Class for translating numbers into Indonesian.
* @author Ernas M. Jamil, Arif Rifai Dwiyanto
* Language name in English
var $lang = 'Indonesia Language';
* The word for the minus sign
var $_minus = 'minus'; // minus sign
* The sufixes for exponents (singular and plural)
* http://www.users.dircon.co.uk/~shaunf/shaun/numbers/millions.htm
24 => array ('quadrillion'),
30 => array ('quintillion'),
36 => array ('sextillion'),
42 => array ('septillion'),
48 => array ('octillion'),
54 => array ('nonillion'),
60 => array ('decillion'),
66 => array ('undecillion'),
72 => array ('duodecillion'),
78 => array ('tredecillion'),
84 => array ('quattuordecillion'),
90 => array ('quindecillion'),
96 => array ('sexdecillion'),
102 => array ('septendecillion'),
108 => array ('octodecillion'),
114 => array ('novemdecillion'),
120 => array ('vigintillion'),
192 => array ('duotrigintillion'),
600 => array ('centillion')
* The array containing the digits (indexed by the digits themselves).
0 => 'nol', 'satu', 'dua', 'tiga', 'empat',
'lima', 'enam', 'tujuh', 'delapan', 'sembilan'
* Converts a number to its word representation
* @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
function toWords($num, $power = 0 , $powsuffix = '') {
if (substr($num, 0 , 1 ) == '-') {
$ret = $this->_sep . $this->_minus;
// strip excessive zero signs and spaces
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 );
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1 ];
$cursuffix .= $this->_sep . $powsuffix;
$ret .= $this->toWords($snum, $p, $cursuffix);
$num = substr($num, $maxp - $curp, $curp - $p + 1 );
} elseif ($num == 0 || $num == '') {
return $this->_sep . $this->_digits[0 ];
$ret .= $this->_sep . 'seribu';
$ret .= $this->_sep . $this->_digits[$th] . $this->_sep . 'ribu';
$ret .= $this->_sep . 'seratus';
$ret .= $this->_sep . $this->_digits[$h] . $this->_sep . 'ratus';
// in English only - add ' and' for [1-9]01..[1-9]99
// (also for 1001..1099, 10001..10099 but it is harder)
// for now it is switched off, maybe some language purists
// can force me to enable it, or to remove it completely
// $ret .= $this->_sep . 'and';
$ret .= $this->_sep . $this->_digits[$t] . ' puluh';
$ret .= $this->_sep . 'sepuluh';
$ret .= $this->_sep . 'sebelas';
$ret .= $this->_sep . $this->_digits[$d] . ' belas';
if ($t != 1 && $d > 0 ) { // add digits only in <0>,<1,9> and <21,inf>
// add minus sign between [2-9] and digit
$ret .= ' ' . $this->_digits[$d];
$ret .= $this->_sep . $this->_digits[$d];
if (isset ($this->_exponent[$power]))
$lev = $this->_exponent[$power];
$ret .= $this->_sep . $lev[0 ];
$ret .= $this->_sep . $powsuffix;
Documentation generated on Mon, 11 Mar 2019 13:55:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|