= 1){ $a = abs($ex[1]); } $string = array("nol", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan","sepuluh", "sebelas"); $temp = ""; $a2 = $ex[1]/10; $pjg = strlen($str); $i =1; if($a>=1 && $a< 12){ $temp .= " ".$string[$a]; }else if($a>12 && $a < 20){ $temp .= konversi($a - 10)." belas"; }else if ($a>20 && $a<100){ $temp .= konversi($a / 10)." puluh". konversi($a % 10); }else{ if($a2<1){ while ($i<$pjg){ $char = substr($str,$i,1); $i++; $temp .= " ".$string[$char]; } } } return $temp; } function terbilang($x){ if($x<0){ $hasil = "minus ".trim(konversi(x)); }else{ $poin = trim(tkoma($x)); $hasil = trim(konversi($x)); } if($poin){ $hasil = $hasil." koma ".$poin; }else{ $hasil = $hasil; } return $hasil; } echo ucwords(terbilang('3,99')); ?>