|
@@ -94,12 +94,13 @@ public class Calculations
|
94
|
94
|
//return the array list
|
95
|
95
|
//else return null'
|
96
|
96
|
|
97
|
|
- Pattern pattern = Pattern.compile("\\s?\\.?\\d+\\.?(\\d+)?\\s?");
|
|
97
|
+ Pattern pattern = Pattern.compile("\\s?\\-?\\.?\\d+\\.?(\\d+)?\\s?");
|
98
|
98
|
Matcher matcher = pattern.matcher(userInput);
|
99
|
99
|
|
100
|
100
|
while(matcher.find()){
|
101
|
101
|
String number = matcher.group().trim();
|
102
|
102
|
Double deci = Double.valueOf(number);
|
|
103
|
+ System.out.println(deci);
|
103
|
104
|
results.add(deci);
|
104
|
105
|
}
|
105
|
106
|
|