> For the complete documentation index, see [llms.txt](https://a-styd.gitbook.io/apexcharts-ruby/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://a-styd.gitbook.io/apexcharts-ruby/options/formatter-function.md).

# Formatter Function

To use a *simple* formatter function (e.g. formatter in `tooltip`, `data_labels`, and `labels`), you can add [functionable-json](https://github.com/styd/functionable-json) to your Gemfile and use it like so:

```erb
<%= area_chart series, tooltip: {y: {formatter: function(val) { return '$' + parseFloat(val).toLocaleString() }}} %>
```

Or, without the *functionable-json* gem, use function as object as follows:

```erb
<%= area_chart series, tooltip: {y: {formatter: {function: {args: "val", body: "return '$' + parseFloat(val).toLocaleString();"}} }} %>
```
