All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.poiji.parser.BigDecimalParser Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
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