Code example for BigDecimal

Methods: unscaledValue

0
 
	/** 
	 * @tests java.math.BigDecimal#BigDecimal(java.math.BigInteger, int) 
	 */ 
	public void test_ConstructorLjava_math_BigIntegerI() { 
		BigDecimal big = new BigDecimal(value2, 5);
		assertTrue("the BigDecimal value is not initialized properly", big
				.unscaledValue().equals(value2)
				&& big.scale() == 5);
		assertTrue("the BigDecimal value is not represented properly", big
				.toString().equals("123345.60000"));
	} 
 
	/** 
	 * @tests java.math.BigDecimal#BigDecimal(double) 
	 */ 
	public void test_ConstructorD() { 
		BigDecimal big = new BigDecimal(123E04);
		assertTrue(
				"the BigDecimal value taking a double argument is not initialized properly", 
				big.toString().equals("1230000"));