Examples of asDecimal()


Examples of org.hisrc.jscm.codemodel.literal.JSDecimalIntegerLiteral.asDecimal()

  @Test
  public void integer() {
    JSDecimalIntegerLiteral integer = codeModel.integer(1);
    Assert.assertEquals(1, integer.asLong());
    Assert.assertEquals(1, integer.asNumber().longValue());
    Assert.assertEquals(1, integer.asDecimal().longValue());

  }
}
View Full Code Here

Examples of org.hisrc.jscm.codemodel.literal.JSDecimalNonIntegerLiteral.asDecimal()

  @Test
  public void decimal() {
    JSDecimalNonIntegerLiteral decimal = codeModel.decimal("1.1");
    Assert.assertEquals(1.1, decimal.asDouble(), 0.00001);
    Assert.assertEquals(1.1, decimal.asDecimal().doubleValue(), 0.00001);
    Assert.assertEquals(1.1, decimal.asNumber().doubleValue(), 0.00001);
    Assert.assertEquals(1, decimal.asNumber().intValue());

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.