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.is24_xml.Is24XmlUtils.java

public static String printZahl32(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(1)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/*from w  w  w  .  j  a  v a2  s  .c  om*/
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl42(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(2)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/*w ww  . j a  v a  2 s  . co m*/
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl52(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(3)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/* w w w .  j a v a 2  s.c om*/
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl62(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(4)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/* w w  w .  j  a  v  a 2s  . c  o  m*/
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl72(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(5)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else//from w w  w  .  ja v a2s . co m
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl102(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(8)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else//from  w ww. j a v  a 2 s  . co  m
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.is24_xml.Is24XmlUtils.java

public static String printZahl152(BigDecimal value) {
    if (value == null || value.compareTo(BigDecimal.ZERO) != 1 || value.compareTo(BigDecimal.TEN.pow(13)) != -1)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/*w w w.  j  a  v  a  2  s .c  o  m*/
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}

From source file:org.openestate.io.kyero.KyeroUtils.java

public static String printDecimal(BigDecimal value) {
    if (value == null)
        throw new IllegalArgumentException("Can't print decimal value '" + value + "'!");
    else/*from w w  w. j  a  v  a  2 s.  c o  m*/
        return DatatypeConverter.printDecimal(value);
}

From source file:org.openestate.io.trovit.TrovitUtils.java

public static String printFloat(BigDecimal value) {
    if (value == null)
        throw new IllegalArgumentException("Can't print float value!");
    else/*from   w w  w  .  j a  va 2 s  . c  om*/
        return DatatypeConverter.printDecimal(value);
}

From source file:org.openestate.io.trovit.TrovitUtils.java

public static String printPriceValue(BigDecimal value) {
    if (value == null)
        throw new IllegalArgumentException("Can't print price value!");
    else//from  www  . j  a  v a2  s.c o  m
        return DatatypeConverter.printDecimal(value.setScale(2, BigDecimal.ROUND_HALF_UP));
}