我想javax.money.CurrencyUnit
通过使用创建:
public static CurrencyUnit getCurrency() {
return Monetary.getCurrency("IDR");
}
但是,我得到了错误:
java.lang.NoClassDefFoundError:
at javax.money.RoundingContextBuilder.<init> (RoundingContextBuilder.java:32)
at javax.money.RoundingContextBuilder.of (RoundingContextBuilder.java:77)
at javax.money.DefaultMonetaryRoundingsSingletonSpi$DefaultCurrencyRounding.<clinit> (DefaultMonetaryRoundingsSingletonSpi.java:266)
at javax.money.DefaultMonetaryRoundingsSingletonSpi.<clinit> (DefaultMonetaryRoundingsSingletonSpi.java:43)
at javax.money.Monetary.loadMonetaryRoundingsSingletonSpi (Monetary.java:125)
at javax.money.Monetary.<clinit> (Monetary.java:54)
at id.co.bippo.bidapplication.util.Utils.getCurrency (Utils.java:912)
在具有规范的android中:
Asus ZenFone 5 (ASUS_T00F), 1024MB RAM, Android 4.3
为了gradle
钱:
compile 'javax.money:money-api-bp:1.0.1'
compile 'org.javamoney:moneta-bp:1.1'