[ 1808211 ] Spanish - Error rutina de monto escrito

This commit is contained in:
Carlos Ruiz 2007-10-05 17:10:22 +00:00
parent fd64a3bbb2
commit e1c28c06cf
1 changed files with 23 additions and 1 deletions

View File

@ -43,6 +43,16 @@ public class AmtInWords_ES implements AmtInWords
" QUINTILL\u00d3N" " QUINTILL\u00d3N"
}; };
private static final String[] majorNamesPlural = {
"",
" MIL",
" MILLONES",
" BILLONES",
" TRILLONES",
" CUATRILLONES",
" QUINTILLONES"
};
private static final String[] tensNames = { private static final String[] tensNames = {
"", "",
" DIEZ", " DIEZ",
@ -158,8 +168,13 @@ public class AmtInWords_ES implements AmtInWords
{ {
soFar = majorNames[place] + soFar; soFar = majorNames[place] + soFar;
} }
else else {
if (n > 1) {
soFar = s + majorNamesPlural[place] + soFar;
} else {
soFar = s + majorNames[place] + soFar; soFar = s + majorNames[place] + soFar;
}
}
} }
place++; place++;
number /= 1000; number /= 1000;
@ -210,5 +225,12 @@ public class AmtInWords_ES implements AmtInWords
} }
return sb.toString (); return sb.toString ();
} // getAmtInWords } // getAmtInWords
public static void main(String[] args) throws Exception {
AmtInWords_ES aiw = new AmtInWords_ES();
// for (int i=0; i<=2147000000; i++)
// System.out.println(aiw.getAmtInWords(i+",00"));
System.out.println(aiw.getAmtInWords("2147483647,99"));
}
} // AmtInWords_ES } // AmtInWords_ES