use of javax.money.NumberValue in project jsr354-ri-bp by JavaMoney.
the class DefaultNumberValueTest method shouldReturnFloat.
@Test
public void shouldReturnFloat() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(numberValue.floatValue(), 132.21F);
}
use of javax.money.NumberValue in project jsr354-ri-bp by JavaMoney.
the class DefaultNumberValueTest method shouldReturnDouble.
@Test
public void shouldReturnDouble() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(numberValue.doubleValue(), 132.21);
}
use of javax.money.NumberValue in project jsr354-ri-bp by JavaMoney.
the class DefaultNumberValueTest method shouldReturnScale.
@Test
public void shouldReturnScale() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(numberValue.getScale(), 2);
}
use of javax.money.NumberValue in project jsr354-ri-bp by JavaMoney.
the class DefaultNumberValueTest method shouldReturnPrecision.
@Test
public void shouldReturnPrecision() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(numberValue.getPrecision(), 5);
}
use of javax.money.NumberValue in project jsr354-ri-bp by JavaMoney.
the class DefaultNumberValueTest method shouldReturnIntValue.
@Test
public void shouldReturnIntValue() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(numberValue.intValue(), 132);
}
Aggregations