com.poiji.parser.BigDecimalParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of poiji2 Show documentation
Show all versions of poiji2 Show documentation
Perfect annotation based library to read and write excel files
package com.poiji.parser;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
public class BigDecimalParser implements Parser {
private final NumberParser delegate;
BigDecimalParser() {
this.delegate = new NumberParser(getDecimalFormatInstance());
}
private DecimalFormat getDecimalFormatInstance() {
final DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getInstance();
decimalFormat.setParseBigDecimal(true);
return decimalFormat;
}
@Override
public BigDecimal parse(String value) {
return (BigDecimal) delegate.parse(value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy