mirror of
https://github.com/heyman/heynote.git
synced 2024-11-24 17:03:19 +01:00
Add info on how to override format() in Math blocks
This commit is contained in:
parent
96667a9d3c
commit
195a00a783
11
README.md
11
README.md
@ -131,6 +131,17 @@ Alt Show menu
|
||||
|
||||
Heynote's Math blocks are powered by [Math.js expressions](https://mathjs.org/docs/expressions). Checkout their [documentation](https://mathjs.org/docs/) to see what [syntax](https://mathjs.org/docs/expressions/syntax.html), [functions](https://mathjs.org/docs/reference/functions.html), and [constants](https://mathjs.org/docs/reference/constants.html) are available.
|
||||
|
||||
## Can I change how the results of Math blocks are formatted?
|
||||
|
||||
Yes! You can define a custom `format` function within the Math block like this:
|
||||
|
||||
```
|
||||
_format = format # store reference to the built in format
|
||||
format(x) = _format(x, {notation:"exponential"})
|
||||
```
|
||||
|
||||
See the [Math.js format()](https://mathjs.org/docs/reference/functions/format.html) function for more info on what's supported.
|
||||
|
||||
|
||||
## Thanks!
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user