Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
public static String printPriceValue(BigDecimal value) {
        if (value == null)
            throw new IllegalArgumentException("Can't print empty price value!");
        if (value.compareTo(BigDecimal.ZERO) < 0)
            throw new IllegalArgumentException("Can't print price value '" + value + "' because it is below 0!");
        if (value.compareTo(new BigDecimal("1000000000")) > 0)
            throw new IllegalArgumentException("Can't print price value '" + value + "' because it is above 1000000000!");

        value = value.setScale(2, BigDecimal.ROUND_HALF_UP);
        return DatatypeConverter.printDecimal(value);
    }
public static String printPriceValue(BigDecimal value) {
        if (value == null)
            throw new IllegalArgumentException("Can't print empty price value!");
        if (value.compareTo(BigDecimal.ZERO) < 0)
            throw new IllegalArgumentException("Can't print price value '" + value + "' because it is below 0!");
        if (value.compareTo(new BigDecimal("1000000000")) > 0)
            throw new IllegalArgumentException("Can't print price value '" + value + "' because it is above 1000000000!");

        value = value.setScale(2, BigDecimal.ROUND_HALF_UP);
        return DatatypeConverter.printDecimal(value);
    }
public static String printPriceValue ( BigDecimal value ) { if ( value == null ) throw new IllegalArgumentException ( "Can't print empty price value!" ) ; if ( value . compareTo ( BigDecimal . ZERO ) < 0 ) throw new IllegalArgumentException ( "Can't print price value '" + value + "' because it is below 0!" ) ; if ( value . compareTo ( new BigDecimal ( "1000000000" ) ) > 0 ) throw new IllegalArgumentException ( "Can't print price value '" + value + "' because it is above 1000000000!" ) ; value = value . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) ; return DatatypeConverter . printDecimal ( value ) ; }
Write a {@link BigDecimal} value into XML output for a price.

@param value value to write
@return XML string
@throws IllegalArgumentException if a validation error occurred
Write a { @link BigDecimal } value into XML output for a price .