Replies: 1 comment
-
What you basically can do is: const expression = '6:3'
const node = math.parse(expression)
const transformedNode = node.transform(node => {
// add your logic here to check for RangeNode and replace it with an OperatorNode doing a division when applicable
})
const result = transformedNode.evaluate() You can find the documation about |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to parse school-ish expressions like
6:3
(that's 2). I know that:
is used in mathjs for ranges.I can't just$\TeX$ ; this replacement results in
.replace(/:/g, '/')
because I need to apply some simplification rules to the parsed expression and then render the expression as\frac
s in the output.Beta Was this translation helpful? Give feedback.
All reactions