What was wrong with DecimalFormat? Have you looked at the BigDecimal(
String) constructor? Those could tell you whether the string will parse to a number. If so, you can figure out how many digits are before & after any decimal point.
In
Java 1.4 and later you could make a regular expression (or two or three) that
test whether a string matches the format you need. See
Pattern in the JavaDoc for more.