Java Code Examples for javax.xml.bind.DatatypeConverter#printDouble()

The following examples show how to use javax.xml.bind.DatatypeConverter#printDouble() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CloverNumericConvertor.java    From CloverETL-Engine with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static String printDoubleToXsdDouble(Double value) throws DataConversionException {
    String result = null;
    
    try {
        result = DatatypeConverter.printDouble(value);
    } catch(Exception e) {
        logger.fatal("Unable to print "+Double.class.getName()+" to xsd:double.",e);
        throw new DataConversionException("Unable to print "+Double.class.getName()+" to xsd:double.", e);
    }
    
    return result;
}
 
Example 2
Source File: NumberUtil.java    From jpmml-model with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
static
public String printNumber(Number value){

	if(value instanceof Float){
		return DatatypeConverter.printFloat(value.floatValue());
	} else

	if(value instanceof Double){
		return DatatypeConverter.printDouble(value.doubleValue());
	} else

	{
		return value.toString();
	}
}
 
Example 3
Source File: ValueConverter.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
static public String DoublePrimitiveToString(double value) {
  return DatatypeConverter.printDouble(value);
}
 
Example 4
Source File: XsValueImpl.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return DatatypeConverter.printDouble(value);
}