You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe "sec" is a built-in alias for the time unit seconds. However, if I type "5 sec" into the https://mathnotepad.com (or the evaluate input on https://mathjs.org) the function sec seems to take precedence and throw a TypeError even though it is expecting a unit:
TypeError: Unexpected type of argument in function multiplyScalar (expected: number or Unit or string or boolean or BigNumber or Complex or Fraction, actual: function, index: 1)
Can we improve the parser to avoid this confusion? It seems the unit "sec" is currently unavailable.
The text was updated successfully, but these errors were encountered:
import{evaluate,format}from'mathjs'console.log(format(evaluate('120 seconds to minutes')))// '2 minutes'console.log(format(evaluate('120 sec to minutes')))// Uncaught TypeError: Unexpected type of argument in function multiplyScalar // (expected: number or Unit or string or boolean or BigNumber or Complex or Fraction, actual: function, index: 1)
Since it seems as though the (side) discussion on this in #2771 was to just accept the fact that in the mathjs parser these units are overridden, changing this to be a documentation issue.
I believe "sec" is a built-in alias for the time unit seconds. However, if I type "5 sec" into the https://mathnotepad.com (or the evaluate input on https://mathjs.org) the function sec seems to take precedence and throw a TypeError even though it is expecting a unit:
TypeError: Unexpected type of argument in function multiplyScalar (expected: number or Unit or string or boolean or BigNumber or Complex or Fraction, actual: function, index: 1)
Can we improve the parser to avoid this confusion? It seems the unit "sec" is currently unavailable.
The text was updated successfully, but these errors were encountered: