Example usage for org.apache.poi.ss.usermodel DataFormatter setExcelStyleRoundingMode

List of usage examples for org.apache.poi.ss.usermodel DataFormatter setExcelStyleRoundingMode

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel DataFormatter setExcelStyleRoundingMode.

Prototype

public static void setExcelStyleRoundingMode(DecimalFormat format) 

Source Link

Document

Enables excel style rounding mode (round half up) on the Decimal Format given.

Usage

From source file:org.apache.tika.parser.microsoft.TikaExcelGeneralFormat.java

License:Apache License

public TikaExcelGeneralFormat(final Locale locale) {
    decimalSymbols = DecimalFormatSymbols.getInstance(locale);
    scientificFormat = new DecimalFormat("0.##############E0", decimalSymbols);
    DataFormatter.setExcelStyleRoundingMode(scientificFormat);
    integerFormat = new DecimalFormat("#", decimalSymbols);
    DataFormatter.setExcelStyleRoundingMode(integerFormat);
    decimalFormat = new DecimalFormat("#.##########", decimalSymbols);
    DataFormatter.setExcelStyleRoundingMode(decimalFormat);
}