Mathjs: Using API Call with Notation: 'fixed' Error

Created on 9 May 2018  路  3Comments  路  Source: josdejong/mathjs

Small back story, I'm trying to round a value to an exact decimal without mathjs dropping the zero with the return value. I'm having a heck of a time with what seems like a simple task. The following screen shot depicts my main hangup. I'm not sure why 'fixed' isn't working and pulling an error. Can someone help me through this obstacle? Is there another function that will solve this problem for me? Again, I don't want mathjs to drop the zero if it rounds up (sometimes these calcs happen and sometimes they don't, but I need it to consistently return the solution to the specified decimal).
2018-05-09_9-43-24

question

All 3 comments

Trying swapping the single quotes around 'fixed' for double quotes (like the error message says :smiley:), you will need to escape the double quotes to make the JSON valid.

@harrysarson Thank you! I'm a novice, so I had no idea about adding the escape to the double quotes! Works like a charm!

No worries, glad I could be of assistance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

comex picture comex  路  5Comments

adamazing picture adamazing  路  4Comments

SamuelMarks picture SamuelMarks  路  3Comments

zcohan picture zcohan  路  4Comments

gnobre picture gnobre  路  4Comments