use of com.amazon.ion.IonDecimal in project ion-java by amzn.
the class _Private_CurriedValueFactory method newDecimal.
public IonDecimal newDecimal(BigDecimal value) {
IonDecimal v = myFactory.newDecimal(value);
handle(v);
return v;
}
use of com.amazon.ion.IonDecimal in project ion-java by amzn.
the class _Private_CurriedValueFactory method newNullDecimal.
// -------------------------------------------------------------------------
public IonDecimal newNullDecimal() {
IonDecimal v = myFactory.newNullDecimal();
handle(v);
return v;
}
use of com.amazon.ion.IonDecimal in project ion-java by amzn.
the class _Private_CurriedValueFactory method newDecimal.
public IonDecimal newDecimal(BigInteger value) {
IonDecimal v = myFactory.newDecimal(value);
handle(v);
return v;
}
use of com.amazon.ion.IonDecimal in project ion-java by amzn.
the class _Private_CurriedValueFactory method newDecimal.
public IonDecimal newDecimal(double value) {
IonDecimal v = myFactory.newDecimal(value);
handle(v);
return v;
}
use of com.amazon.ion.IonDecimal in project ion-java by amzn.
the class PrinterTest method testPrintingDecimal.
@Test
public void testPrintingDecimal() throws Exception {
IonDecimal value = system().newNullDecimal();
checkNullRendering("null.decimal", value);
value.setValue(-123);
checkRendering("-123.", value);
value.setValue(456);
checkRendering("456.", value);
value.setValue(0);
checkRendering("0.", value);
value.addTypeAnnotation("an");
checkRendering("an::0.", value);
value = (IonDecimal) oneValue("0d42");
checkRendering("0d42", value);
value = (IonDecimal) oneValue("0d+42");
checkRendering("0d42", value);
value = (IonDecimal) oneValue("0d-42");
checkRendering("0d-42", value);
value = (IonDecimal) oneValue("100d-1");
checkRendering("10.0", value);
value = (IonDecimal) oneValue("100d3");
checkRendering("100d3", value);
myPrinter.setPrintDecimalAsFloat(true);
checkRendering("100e3", value);
}
Aggregations