function convertir_a_letras($numero)
{
    global $importe_parcial;
    $importe_parcial = $numero;
    if ($numero < 1000000000) {
        if ($numero >= 1000000 && $numero <= 999999999.99) {
            $num_letras = millon() . cien_mil() . cien();
        } else {
            if ($numero >= 1000 && $numero <= 999999.99) {
                $num_letras = cien_mil() . cien();
            } else {
                if ($numero >= 1 && $numero <= 999.99) {
                    $num_letras = cien();
                } else {
                    if ($numero >= 0.01 && $numero <= 0.99) {
                        if ($numero == 0.01) {
                            $num_letras = "un céntimo";
                        } else {
                            $num_letras = convertir_a_letras($numero * 100 . "/100") . " céntimos";
                        }
                    }
                }
            }
        }
    }
    return $num_letras;
}
예제 #2
0
 function cienmillon($numcmeros)
 {
     if ($numcmeros == 100000000) {
         $num_letracms = "CIEN MILLONES";
     }
     if ($numcmeros >= 100000000 && $numcmeros < 1000000000) {
         $num_letracms = centena(Floor($numcmeros / 1000000)) . " MILLONES " . millon($numcmeros % 1000000);
     }
     if ($numcmeros < 100000000) {
         $num_letracms = decmillon($numcmeros);
     }
     return $num_letracms;
 }
예제 #3
0
 function decmillon($numerodm)
 {
     if ($numerodm == 10000000) {
         $num_letradmm = "DIEZ MILLONES";
     }
     if ($numerodm > 10000000 && $numerodm < 20000000) {
         $num_letradmm = decena(Floor($numerodm / 1000000)) . "MILLONES " . cienmiles($numerodm % 1000000);
     }
     if ($numerodm >= 20000000 && $numerodm < 100000000) {
         $num_letradmm = decena(Floor($numerodm / 1000000)) . " MILLONES " . millon($numerodm % 1000000);
     }
     if ($numerodm < 10000000) {
         $num_letradmm = millon($numerodm);
     }
     return $num_letradmm;
 }