We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation states that the only barrier to adding extended character support is overwriting the Unit.isValidAlpha method (https://mathjs.org/docs/datatypes/units.html#support-of-custom-characters-in-unit-names)
The following code produces an Error
const isAlphaOriginal = math.Unit.isValidAlpha const isDegOrPercent = function (c) { return c === "°" || c === "%" } math.Unit.isValidAlpha = function (c) { return isAlphaOriginal(c) || isDegOrPercent(c) } math.createUnit('°', '1 deg') math.createUnit('%', '0.01') math.evaluate('12.7 ° to deg')
Error: SyntaxError: Syntax error in part "° to deg"
SyntaxError: Syntax error in part "° to deg"
This is reproducible in the demo JSBin (2021-11-15) and Version 9.4.1
Thank you for your library.
The text was updated successfully, but these errors were encountered:
You'll also have to override the isAlpha of the expression parser, math.expression.parse.isAlpha.
isAlpha
math.expression.parse.isAlpha
See #1268
Sorry, something went wrong.
No branches or pull requests
Documentation states that the only barrier to adding extended character support is overwriting the Unit.isValidAlpha method (https://mathjs.org/docs/datatypes/units.html#support-of-custom-characters-in-unit-names)
The following code produces an Error
Error:
SyntaxError: Syntax error in part "° to deg"
This is reproducible in the demo JSBin (2021-11-15) and Version 9.4.1
Thank you for your library.
The text was updated successfully, but these errors were encountered: