Joda-Money provides a Java library of classes to store money amount.
Questions tagged [joda-money]
21 questions
1
vote
3 answers
UserType / Hibernate / JodaMoney error : PersistentMoneyAmount requires currencyCode to be defined as a parameter
I'm using UserType 3.0.0.RC1 to map JodaMoney to Hibernate.
I'm stuck with an error when the SessionFactory initialises:
PersistentMoneyAmount requires currencyCode to be defined as a
parameter, or the defaultCurrencyCode Hibernate property to be…

Marty Pitt
- 28,822
- 36
- 122
- 195
0
votes
0 answers
Is any Joda library method is there to convert Joda.Money to Pennies?
I want to convert Joda.Money to pennies. Is there any Joda library method available?
Sample input:
USD 233.33
Sample output:
23333
Tried below 2 options:
tried with Money.getAmountMinorInt() and it's returning with multiplies of 100.
getAmount…

Remo
- 534
- 7
- 26
0
votes
0 answers
C# Is it possible to disallow constructors with implicit conversions?
I want to use the Money pattern to decrease the likelihood of mistakes that incur using raw numbers such as decimal, etc.
Some parts of the system use int64, representing money in minor units i.e. 12345¢. I want to make it explicit that money is…

mazin
- 395
- 2
- 7
0
votes
1 answer
Joda money: How to convert formatted string back to monetary value (independent of locale)
Assume we have the amount $12345.67
This can be converted into a Monetary value using joda money library with:
Money parsed = Money.parse("USD 12345.67");
//Now to display the amount according to the users locale we use:
MoneyFormatter mf = …

Avinta
- 678
- 1
- 9
- 26
0
votes
2 answers
print jodamoney without decimals
I know how to print a joda-money object using the MoneyFormatterBuilder:
Money m = Money.of(CurrencyUnit.USD, 48209);
System.out.println(new…

ryvantage
- 13,064
- 15
- 63
- 112
-1
votes
1 answer
can't serialize class org.joda.money.BigMoney
I am trying to insert into mongo DB and am getting the following error when I try and insert a joda big money object
"can't serialize class org.joda.money.BigMoney"
however according to the java doc BigMoney does implement serializable (…

James
- 1
- 1