Skip to content
This repository was archived by the owner on Jun 27, 2021. It is now read-only.

Commit ebee750

Browse files
committed
Removed refs to Money.of(...).
1 parent 9006f95 commit ebee750

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

UserGuide.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,11 @@ A total of amounts can be calculated in multiple ways, one way is simply to chai
285285
[source,java]
286286
.Usage Example Calculating a Total
287287
-------------------------------------------------------------------
288+
MonetaryAmountFactory factory = Monetary.getDefaultAmountFactory().setCurrency("CHF");
288289
MonetaryAmount[] params = new MonetaryAmount[]{
289-
Money.of("CHF", 100), Money.of("CHF", 10.20),
290-
Money.of("CHF", 1.15),};
290+
factory.setNumber(100).create(),
291+
factory.setNumber(10.20).create(),
292+
factory.setNumber(1.15).create(),};
291293
MonetaryAmount total = params[0];
292294
for(int i=1; i<params.length;i++){
293295
total = total.add(params[i]);
@@ -414,7 +416,7 @@ calculated as follows:
414416
[source,java]
415417
.Example Using a Financial Function
416418
-------------------------------------------------------------------
417-
Money m = Money.of("CHF", 1000);
419+
Money m = Monetary.getAmountFactory(Money.class).setCurrency("CHF").setNumber(1000).create();
418420
// present value for an amount of 100, available in two periods,
419421
// with a rate of 5%.
420422
Money pv = m.with(new PresentValue(new BigDecimal("0.05"), 2));

0 commit comments

Comments
 (0)