We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42ceb0c commit 8ffc866Copy full SHA for 8ffc866
utils/QueryProcessor.tsx
@@ -37,6 +37,16 @@ export default function QueryProcessor(query: string): string {
37
return (left * right).toString();
38
}
39
40
+ const multiplyPlusMatch = query
41
+ .toLowerCase()
42
+ .match(/what is\s*(-?\d+(?:\.\d+)?)\s*multiplied by\s*(-?\d+(?:\.\d+)?)\s*plus\s*(-?\d+(?:\.\d+)?)\?/);
43
+ if (multiplyPlusMatch) {
44
+ const left = Number(multiplyPlusMatch[1]);
45
+ const middle = Number(multiplyPlusMatch[2]);
46
+ const right = Number(multiplyPlusMatch[3]);
47
+ return (left * middle + right).toString();
48
+ }
49
+
50
const minusMatch = query
51
.toLowerCase()
52
.match(/what is\s*(-?\d+(?:\.\d+)?)\s*minus\s*(-?\d+(?:\.\d+)?)\?/);
0 commit comments