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(
91
91
} else if ("subtract" .equals (operation )) {
92
92
return amount1 .subtract (amount2 );
93
93
} else if ("multiply" .equals (operation )) {
94
- return amount1 .multiply (amount2 );
94
+ return amount1 .multiply (amount2 . doubleValue () );
95
95
} else if ("divide" .equals (operation )) {
96
- return amount1 .divide (amount2 );
96
+ return amount1 .divide (amount2 . doubleValue () );
97
97
} else if ("divideToIntegralValue"
98
98
.equals (operation )) {
99
- return amount1 .divideToIntegralValue (amount2 );
99
+ return amount1 .divideToIntegralValue (amount2 . doubleValue () );
100
100
// } else if ("max".equals(operation)) {
101
101
// return amount1.max(amount2);
102
102
// } else if ("min".equals(operation)) {
103
103
// return amount1.min(amount2);
104
104
} else if ("remainder" .equals (operation )) {
105
- return amount1 .remainder (amount2 );
105
+ return amount1 .remainder (amount2 . doubleValue () );
106
106
}
107
107
return null ;
108
108
}
Original file line number Diff line number Diff line change 21
21
import net .java .javamoney .fxdemo .widgets .AbstractExamplePane ;
22
22
import net .java .javamoney .fxdemo .widgets .AbstractSingleSamplePane ;
23
23
import 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 ;
25
25
26
26
public class FormatAmount extends AbstractExamplePane {
27
27
@@ -56,7 +56,7 @@ public void handle(ActionEvent action) {
56
56
try {
57
57
MonetaryAmount amount = amount1 .getAmount ();
58
58
LocalizationStyle .Builder styleBuilder = new LocalizationStyle .Builder (
59
- "default" , Locale . ENGLISH );
59
+ MonetaryAmount . class );
60
60
if (groupSizes .getText () != null ) {
61
61
String [] groups = groupSizes .getText ()
62
62
.split ("," );
@@ -80,7 +80,7 @@ public void handle(ActionEvent action) {
80
80
pw .println ("Formatted Amount" );
81
81
pw .println ("----------------" );
82
82
if (formatter != null ) {
83
- pw .println (formatter .format (amount ));
83
+ pw .println (formatter .format (amount , Locale . getDefault () ));
84
84
} else {
85
85
pw .println ("N/A: No formatter available." );
86
86
}
You can’t perform that action at this time.
0 commit comments