private String convertLessThanOneThousand(int number){
  String soFar;
  if (number % 100 < 20) {
    soFar=numNames[number % 100];
    number/=100;
  }
 else {
    soFar=numNames[number % 10];
    number/=10;
    String s=Integer.toString(number);
    if (s.endsWith("2") && !soFar.equals(""))     soFar=" VEINTI" + soFar.trim();
 else     if (soFar.equals(""))     soFar=tensNames[number % 10] + soFar;
 else     soFar=tensNames[number % 10] + " Y" + soFar;
    number/=10;
  }
  if (number == 0)   return tensNames[number % 10] + soFar;
  if (number > 1)   soFar="S" + soFar;
  if (number == 1 && !soFar.equals(""))   number=0;
  return numNames[number] + " CIENTO" + soFar;
}

private String convertLessThanOneThousand ( int number ) { String soFar ; if ( number % 100 < 20 ) { soFar = numNames [ number % 100 ] ; number /= 100 ; } else { soFar = numNames [ number % 10 ] ; number /= 10 ; String s = Integer . toString ( number ) ; if ( s . endsWith ( "2" ) && ! soFar . equals ( "" ) ) soFar = " VEINTI" + soFar . trim ( ) ; else if ( soFar . equals ( "" ) ) soFar = tensNames [ number % 10 ] + soFar ; else soFar = tensNames [ number % 10 ] + " Y" + soFar ; number /= 10 ; } if ( number == 0 ) return tensNames [ number % 10 ] + soFar ; if ( number > 1 ) soFar = "S" + soFar ; if ( number == 1 && ! soFar . equals ( "" ) ) number = 0 ; return numNames [ number ] + " CIENTO" + soFar ; }
convert less than one thousand
