Skip to content

Commit

Permalink
Move Math blocks' format and toLocaleString() example from README int…
Browse files Browse the repository at this point in the history
…o docs/
  • Loading branch information
heyman committed Jul 14, 2024
1 parent e84b362 commit 8e24fe9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ _format = format # store reference to the built in format
format(x) = _format(x, {notation:"exponential"})
```

You can also do something like this to show the number with your default locale or provide a [custom one](https://www.w3.org/International/articles/language-tags/):

```
format(x) = x.toLocaleString();
format(x) = x.toLocaleString('en-GB');
```


See the [Math.js format()](https://mathjs.org/docs/reference/functions/format.html) function for more info on what's supported.

## The buffer file
Expand Down

0 comments on commit 8e24fe9

Please sign in to comment.