package org.javamoney.moneybook.chapter.three;

import org.javamoney.moneta.Money;
import org.javamoney.moneta.function.MonetaryOperators;

import javax.money.CurrencyUnit;
import javax.money.Monetary;
import javax.money.MonetaryAmount;
import java.util.Locale;

/**
 * Created by otaviojava on 27/05/15.
 */
public class MonetaryOperatorsExample {

    public static void main(String[] args) {
        CurrencyUnit currency = Monetary.getCurrency("BRL");
        CurrencyUnit dollar = Monetary.getCurrency(Locale.US);

        MonetaryAmount money = Money.of(120.231, currency);

        MonetaryAmount majorPartResult = money.with(MonetaryOperators.majorPart());//BRL 120
        MonetaryAmount minorPartResult = money.with(MonetaryOperators.minorPart());//BRL 0.231
        MonetaryAmount percentResult = money.with(MonetaryOperators.percent(20));//BRL 24.0462
        MonetaryAmount permilResult = money.with(MonetaryOperators.permil(100));//BRL 12.0231
        MonetaryAmount roundingResult = money.with(MonetaryOperators.rounding());//BRL 120.23
        MonetaryAmount resultExchange = money.with(MonetaryOperators.exchange(dollar));//USD 120.231
    }
}

@@ -52,90 +52,24 @@
 ort 
-org.javamoney.moneta.Money;%0Aimport org.javamoney.moneta.function.MonetaryOperators
+java.util.Locale
 ;%0A%0Ai
@@ -164,39 +164,163 @@
 Amount;%0A
+%0A
 import 
-java.util.Locale
+org.javamoney.moneta.Money;%0Aimport org.javamoney.moneta.convert.ConversionOperators;%0Aimport org.javamoney.moneta.function.MonetaryOperators
 ;%0A%0A/**%0A 
@@ -1150,32 +1150,34 @@
  money.with(
-Monetary
+Conversion
 Operators.ex

Update the Operator with the new Classe ConversionOperatos