Skip to content

Commit

Permalink
Fixed year formatting issues for year < 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
datasetutil committed Mar 26, 2015
1 parent fef0827 commit 6d5c0fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/sforce/dataset/loader/EbinFormatWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class EbinFormatWriter {

Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
DecimalFormat df = new DecimalFormat("00");
DecimalFormat df4 = new DecimalFormat("0000");

public static final NumberFormat nf = NumberFormat.getIntegerInstance();
long startTime = 0L;
Expand Down Expand Up @@ -426,7 +427,7 @@ public void addrow(String[] values) throws IOException,NumberFormatException, P
curr.put(_dataTypes.get(key_value_count).getName(), (month+1));
key_value_count++;

dim_values.add(Integer.toString(year));
dim_values.add(df4.format(year));
dim_keys.add(_dataTypes.get(key_value_count).getName());
curr.put(_dataTypes.get(key_value_count).getName(), year);
// System.out.println(_dataTypes.get(key_value_count).getName() + ": "+columnValue + " - "+ year);
Expand Down Expand Up @@ -472,7 +473,7 @@ public void addrow(String[] values) throws IOException,NumberFormatException, P
curr.put(_dataTypes.get(key_value_count).getName(), (fiscal_month+1));
key_value_count++;

dim_values.add(Integer.toString(fiscal_year));
dim_values.add(df4.format(fiscal_year));
dim_keys.add(_dataTypes.get(key_value_count).getName());
curr.put(_dataTypes.get(key_value_count).getName(), fiscal_year);
key_value_count++;
Expand Down

0 comments on commit 6d5c0fb

Please sign in to comment.