Specifying Precision

You specify the minimum and maximum of each type you want in each number using these four methods:

public void setMaximumIntegerDigits(int newValue)
public void setMinimumIntegerDigits(int newValue)
public void setMaximumFractionDigits(int newValue)
public void setMinimumFractionDigits(int newValue)

For example, to specify that myFormat should format numbers with at least 10 digits before the decimal point and at most 3 digits after, you would type:

myFormat.setMinimumIntegerDigits(10);
myFormat.setMaximumFractionDigits(3);


Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 29, 2000