heynote
heynote copied to clipboard
Is there a way to have a javascript function for format in math blocks?
I don't know or think this is possible, but thought of asking.
I wanted to format the numbers with some locale as they are currently currency and it's easier to follow.
I managed to do it with:
format(x) = x.toLocaleString('es-ar');
However, I am not super sure about to extent of javascript I could do with format. I tried complex functions, anonymous functions, arrows functions ,but none worked. It this this work only because it ends up being a valid math block function, but can I use a more complex format callback some how in the max block?
The syntax should be that of Math.js expressions:
https://mathjs.org/docs/expressions/ https://mathjs.org/docs/expressions/syntax.html