Code example for NumberFormat

Methods: setGroupingUsed, setMinimumIntegerDigits

0
 
public class TestFieldSelection extends TestCase {
 
private static NumberFormat idFormat = NumberFormat.getInstance();
  static { 
    idFormat.setMinimumIntegerDigits(4);
    idFormat.setGroupingUsed(false);
  } 
 
  public void testFieldSelection() throws Exception { 
    launch(); 
  } 
 
  public static void launch() throws Exception { 
    JobConf conf = new JobConf(TestFieldSelection.class);
    FileSystem fs = FileSystem.get(conf);
    int numOfInputLines = 10;
 
    Path OUTPUT_DIR = new Path("build/test/output_for_field_selection_test");
    Path INPUT_DIR = new Path("build/test/input_for_field_selection_test");
    String inputFile = "input.txt";