= 100) { $jkl = intval($i / 100); $words .= $hang_ru[$jkl]; $i %= 100; } if ($i >= 20) { $jkl = intval($i / 10); $words .= $des_ru[$jkl]; $i %= 10; $fl = 1; } switch ($i) { case 1: $fem = 1; break; case 2: case 3: case 4: $fem = 2; break; default: $fem = 3; break; } if ($i) { if ($i < 3 && $f > 0) { if ($f >= 2) { $words .= $_1_19_ru[$i]; } else { $words .= $_1_2_ru[$i]; } } else { $words .= $_1_19_ru[$i]; } } } } if (!function_exists('num2str_ru')) { function num2str_ru($L) { $L = str_replace(array(' ', ','), array('', '.'), $L); global $namerub_ru, $nametho_ru, $namemil_ru, $namemrd_ru, $kopeek_ru; $s = " "; $s1 = " "; $s2 = " "; $kop = intval(($L * 100 - intval($L) * 100)); $L = intval($L); if ($L >= 1000000000) { $many = 0; semantic_ru(intval($L / 1000000000), $s1, $many, 3); $s .= $s1 . $namemrd_ru[$many]; $L %= 1000000000; } if ($L >= 1000000) { $many = 0; semantic_ru(intval($L / 1000000), $s1, $many, 2); $s .= $s1 . $namemil_ru[$many]; $L %= 1000000; if ($L == 0) { $s .= "рублей "; } } if ($L >= 1000) { $many = 0; semantic_ru(intval($L / 1000), $s1, $many, 1); $s .= $s1 . $nametho_ru[$many]; $L %= 1000; if ($L == 0) { $s .= "рублей "; } } if ($L != 0) { $many = 0; semantic_ru($L, $s1, $many, 0); $s .= $s1 . $namerub_ru[$many]; } if ($kop > 0) { $many = 0; semantic_ru($kop, $s1, $many, 1); $s .= $s1 . $kopeek_ru[$many]; } else { $s .= " 00 копеек"; } return $s; } }