Example usage for javax.xml.bind DatatypeConverter printDecimal

List of usage examples for javax.xml.bind DatatypeConverter printDecimal

Introduction

In this page you can find the example usage for javax.xml.bind DatatypeConverter printDecimal.

Prototype

public static String printDecimal(java.math.BigDecimal val) 

Source Link

Document

Converts a BigDecimal value into a string.

Usage

From source file:org.openestate.io.wis_it.WisItUtils.java

public static String printDecimal(BigDecimal value) {
    if (value == null)
        throw new IllegalArgumentException("Can't print decimal value!");
    else//ww  w. ja v  a  2  s  .c om
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}