Skip to content

Commit

Permalink
Updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
keilw committed Aug 12, 2013
1 parent 78a0d01 commit b5dcc6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ private MonetaryAmount performOperation(
} else if ("subtract".equals(operation)) {
return amount1.subtract(amount2);
} else if ("multiply".equals(operation)) {
return amount1.multiply(amount2);
return amount1.multiply(amount2.doubleValue());
} else if ("divide".equals(operation)) {
return amount1.divide(amount2);
return amount1.divide(amount2.doubleValue());
} else if ("divideToIntegralValue"
.equals(operation)) {
return amount1.divideToIntegralValue(amount2);
return amount1.divideToIntegralValue(amount2.doubleValue());
// } else if ("max".equals(operation)) {
// return amount1.max(amount2);
// } else if ("min".equals(operation)) {
// return amount1.min(amount2);
} else if ("remainder".equals(operation)) {
return amount1.remainder(amount2);
return amount1.remainder(amount2.doubleValue());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import net.java.javamoney.fxdemo.widgets.AbstractExamplePane;
import net.java.javamoney.fxdemo.widgets.AbstractSingleSamplePane;
import net.java.javamoney.fxdemo.widgets.AmountEntry;
import net.java.javamoney.ri.format.impl.IsoAmountFormatter.CurrencyPlacement;
import net.java.javamoney.ri.format.IsoAmountFormatter.CurrencyPlacement;

public class FormatAmount extends AbstractExamplePane {

Expand Down Expand Up @@ -56,7 +56,7 @@ public void handle(ActionEvent action) {
try {
MonetaryAmount amount = amount1.getAmount();
LocalizationStyle.Builder styleBuilder = new LocalizationStyle.Builder(
"default", Locale.ENGLISH);
MonetaryAmount.class);
if (groupSizes.getText() != null) {
String[] groups = groupSizes.getText()
.split(",");
Expand All @@ -80,7 +80,7 @@ public void handle(ActionEvent action) {
pw.println("Formatted Amount");
pw.println("----------------");
if (formatter != null) {
pw.println(formatter.format(amount));
pw.println(formatter.format(amount, Locale.getDefault()));
} else {
pw.println("N/A: No formatter available.");
}
Expand Down

0 comments on commit b5dcc6c

Please sign in to comment.