2

I would like to use math.js functions in Google Sheets script editor. How can I make math.js accessible?

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Transpile it to a js1.6 compatible Apps Script library. Eval a remote url. Use a sidebar/modal with `HtmlService`, and import it there like in a browser. Too many ways to get an actual useful answer from your broad question. – tehhowch Oct 07 '18 at 19:13
  • 3
    There's a official [api](http://api.mathjs.org/) too. – TheMaster Oct 07 '18 at 20:59
  • 1
    The uncompressed mathjs file is 65 thousand lines long. [Mathjs link](https://unpkg.com/mathjs@5.2.0/dist/math.js) I'm not sure how the Apps Script code editor would handle that being pasted into a file. It looks like the Mathjs code uses the `find` method, which the current JavaScript version in Apps Script doesn't have. It could be a lot of work to try to use the code directly in Apps Script. – Alan Wells Oct 07 '18 at 23:33
  • Capitalize math --> Math.whatever works. MATH.whatever and math.whatever do not. Speaking from experience – aNewb Nov 23 '20 at 22:06

0 Answers0