Internalizzazione Java - Imposta precisione min / max
In questo esempio, stiamo impostando le cifre min e max sia per la parte intera che per la parte frazionaria di un numero.
IOTester.java
import java.text.NumberFormat;
import java.util.Locale;
public class I18NTester {
   public static void main(String[] args) {
      Locale enLocale = new Locale("en", "US");  
      NumberFormat numberFormat = NumberFormat.getInstance(enLocale);
      numberFormat.setMinimumIntegerDigits(2);
      numberFormat.setMaximumIntegerDigits(3);
      numberFormat.setMinimumFractionDigits(2);
      numberFormat.setMaximumFractionDigits(3);
      System.out.println(numberFormat.format(12234.763443));
   }
}Produzione
Stamperà il seguente risultato.
234.763