Following the instructions in the documentation on overriding the 'math.expression.parse.isAlpha' function, I have successfully customised supported characters for variables.
Can I do the same for units? The issue I'm running into is syntax errors when defining aliases for certain currencies with non-alpha symbols (i.e '£' for GBP & '€' for EUR).
Here's my code:
math.createUnit('USD')
math.createUnit('EUR', {definition: '1.18 USD', aliases: ['€']})
math.eval('10 USD in €')
I get "SyntaxError: Unexpected "€" in "€" at index 0"
Following the instructions in the documentation on overriding the 'math.expression.parse.isAlpha' function, I have successfully customised supported characters for variables.
Can I do the same for units? The issue I'm running into is syntax errors when defining aliases for certain currencies with non-alpha symbols (i.e '£' for GBP & '€' for EUR).
Here's my code:
I get "SyntaxError: Unexpected "€" in "€" at index 0"