-
I have the following unit: USD: {
definition: '0.xxx EUR'`, // This comes from an API
aliases: ['usd', '$']
} Unfortunately, while |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
The expression parser allows only a limited set of characters variable names. You can customize this to also allow characters like https://mathjs.org/docs/expressions/customization.html#customize-supported-characters |
Beta Was this translation helpful? Give feedback.
-
I'm not sure this answers it.
Any plans on allowing currency symbols in units? |
Beta Was this translation helpful? Give feedback.
-
Good point. So indeed you need to override both |
Beta Was this translation helpful? Give feedback.
-
You don't have to override
|
Beta Was this translation helpful? Give feedback.
-
True, you only need to adjust |
Beta Was this translation helpful? Give feedback.
You don't have to override
math.parse.isAlpha
since it it's not used in conjunction withmath.Unit
as it stands currently. But you're right, you can just customizemath.Unit.isValidAlpha
. So something like this would do: