We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f857d6c commit b404cd2Copy full SHA for b404cd2
1 file changed
utils/QueryProcessor.tsx
@@ -16,10 +16,14 @@ export default function QueryProcessor(query: string): string {
16
}
17
if (query.toLowerCase().includes("plus")) {
18
const numbers = query.match(/\d+/g);
19
- if (numbers && numbers.length >= 2) {
+ if (numbers && numbers.length == 2) {
20
const sum = parseInt(numbers[0]) + parseInt(numbers[1]);
21
return sum.toString();
22
23
+ if (numbers && numbers.length == 3) {
24
+ const sum = parseInt(numbers[0]) + parseInt(numbers[1]) + parseInt(numbers[2]);
25
+ return sum.toString();
26
+ }
27
28
if (query.toLowerCase().includes("minus")) {
29
0 commit comments