-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable to get the original value of a number
Signed-off-by: Hakan Ozler <ozler.hakan@gmail.com>
- Loading branch information
1 parent
32d1215
commit 013d6d9
Showing
6 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/poiji/bind/mapping/PoijiDataFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.poiji.bind.mapping; | ||
|
||
import com.poiji.option.PoijiOptions; | ||
import org.apache.poi.ss.usermodel.DataFormatter; | ||
import org.apache.poi.ss.util.NumberToTextConverter; | ||
|
||
/** | ||
* Created by hakan on 16.05.2021 | ||
*/ | ||
public class PoijiDataFormatter extends DataFormatter { | ||
|
||
PoijiOptions options; | ||
|
||
public PoijiDataFormatter(PoijiOptions options) { | ||
super(); | ||
this.options = options; | ||
} | ||
|
||
@Override | ||
public String formatRawCellContents(double value, int formatIndex, String formatString, boolean use1904Windowing) { | ||
String cellContents = super.formatRawCellContents(value, formatIndex, formatString, use1904Windowing); | ||
|
||
if (options.isReturnRawValues()) { | ||
return NumberToTextConverter.toText(value); | ||
} else { | ||
return cellContents; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.