File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
javafx/money-fxdemo/src/main/java/net/java/javamoney/fxdemo Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,18 @@ private MonetaryAmount performOperation(
9191 } else if ("subtract" .equals (operation )) {
9292 return amount1 .subtract (amount2 );
9393 } else if ("multiply" .equals (operation )) {
94- return amount1 .multiply (amount2 );
94+ return amount1 .multiply (amount2 . doubleValue () );
9595 } else if ("divide" .equals (operation )) {
96- return amount1 .divide (amount2 );
96+ return amount1 .divide (amount2 . doubleValue () );
9797 } else if ("divideToIntegralValue"
9898 .equals (operation )) {
99- return amount1 .divideToIntegralValue (amount2 );
99+ return amount1 .divideToIntegralValue (amount2 . doubleValue () );
100100// } else if ("max".equals(operation)) {
101101// return amount1.max(amount2);
102102// } else if ("min".equals(operation)) {
103103// return amount1.min(amount2);
104104 } else if ("remainder" .equals (operation )) {
105- return amount1 .remainder (amount2 );
105+ return amount1 .remainder (amount2 . doubleValue () );
106106 }
107107 return null ;
108108 }
Original file line number Diff line number Diff line change 2121import net .java .javamoney .fxdemo .widgets .AbstractExamplePane ;
2222import net .java .javamoney .fxdemo .widgets .AbstractSingleSamplePane ;
2323import net .java .javamoney .fxdemo .widgets .AmountEntry ;
24- import net .java .javamoney .ri .format .impl . IsoAmountFormatter .CurrencyPlacement ;
24+ import net .java .javamoney .ri .format .IsoAmountFormatter .CurrencyPlacement ;
2525
2626public class FormatAmount extends AbstractExamplePane {
2727
@@ -56,7 +56,7 @@ public void handle(ActionEvent action) {
5656 try {
5757 MonetaryAmount amount = amount1 .getAmount ();
5858 LocalizationStyle .Builder styleBuilder = new LocalizationStyle .Builder (
59- "default" , Locale . ENGLISH );
59+ MonetaryAmount . class );
6060 if (groupSizes .getText () != null ) {
6161 String [] groups = groupSizes .getText ()
6262 .split ("," );
@@ -80,7 +80,7 @@ public void handle(ActionEvent action) {
8080 pw .println ("Formatted Amount" );
8181 pw .println ("----------------" );
8282 if (formatter != null ) {
83- pw .println (formatter .format (amount ));
83+ pw .println (formatter .format (amount , Locale . getDefault () ));
8484 } else {
8585 pw .println ("N/A: No formatter available." );
8686 }
You can’t perform that action at this time.
0 commit comments