How would I make a java.text.NumberFormat
instance that only allows positive integer numbers?
Actually, it would be nice if it only allowed from 1 and on.
Docs say that the formatting for postive/negative is divided by the ";" character, but putting nothing in the negative formatting or simply not using the ";" doesn't disables negative numbers.
These won't do it apparently:
NumberFormat nf = new DecimalFormat("#;");
// or
NumberFormat nf = new DecimalFormat("#");
// or
NumberFormat nf = new DecimalFormat("#;0");