use of javax.money.NumberValue in project jsr354-ri 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 by JavaMoney.
the class DefaultNumberValueTest method shouldReturnAmountFractionNumerator.
@Test
public void shouldReturnAmountFractionNumerator() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(132.21));
assertEquals(21L, numberValue.getAmountFractionNumerator());
}
use of javax.money.NumberValue in project jsr354-ri 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 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 shoudReturnAmountFractionNumerator.
@Test
public void shoudReturnAmountFractionNumerator() {
NumberValue numberValue = DefaultNumberValue.of(BigDecimal.valueOf(62.5));
assertEquals(5L, numberValue.getAmountFractionNumerator());
assertEquals(10L, numberValue.getAmountFractionDenominator());
}
Aggregations