You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
javax.money.MonetaryAmount#stripTrailingZeros() is confusing for two reasons:
It seems to be the only method left on MonetaryAmount that operates on the number value. #getAmountWhole() has been removed and #getAmountFractionNumerator() and #getAmountFractionDenominator() have been moved to javax.money.NumberValue.
It assumes the implementation has an adjustable scale like BigDecimal/org.javamoney.moneta.Money. It is unspecified that should happen in cases where the scale is fixed like for org.javamoney.moneta.FastMoney.
It could either be moved to javax.money.NumberValue like #getAmountFractionNumerator() and #getAmountFractionDenominator() or a user could simply do
I understand that changing the ABI may not be an option.
What would be nice if we could formalise / specify the behaviour for implementations with a fixed scale.
javax.money.MonetaryAmount#stripTrailingZeros()
is confusing for two reasons:MonetaryAmount
that operates on the number value.#getAmountWhole()
has been removed and#getAmountFractionNumerator()
and#getAmountFractionDenominator()
have been moved tojavax.money.NumberValue
.BigDecimal
/org.javamoney.moneta.Money
. It is unspecified that should happen in cases where the scale is fixed like fororg.javamoney.moneta.FastMoney
.It could either be moved to
javax.money.NumberValue
like#getAmountFractionNumerator()
and#getAmountFractionDenominator()
or a user could simply doThe text was updated successfully, but these errors were encountered: