Skip to content

Commit

Permalink
docs / metrics view locale_d3 example (#6149)
Browse files Browse the repository at this point in the history
* Will adda few examples to format_d3_loacle

* Adding format_d3_locale example
  • Loading branch information
royendo authored Dec 6, 2024
1 parent 832430d commit 4623c95
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/docs/reference/project-files/metrics-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ In your Rill project directory, create a metrics view, `<metrics_view>.yaml`, fi
- **Example**: to show a measure using fixed point formatting with 2 digits after the decimal point, your measure specification would include: `format_d3: ".2f"`.
- **Example**: to show a measure using grouped thousands with two significant digits, your measure specification would include: `format_d3: ",.2r"`.
- **`format_d3_locale`** — locale configuration passed through to D3, enabling changing the currency symbol among other things. For details, see the docs for D3's [`formatLocale`](https://d3js.org/d3-format#formatLocale). _(optional)_

```yaml
format_d3: "$,"
format_d3_locale:
grouping: [3, 2]
currency: ["₹", ""]
```
- **`format_preset`** — controls the formatting of this measure according to option specified below. Measures <u>cannot</u> have both `format_preset` and `format_d3` entries. _(optional; if neither `format_preset` nor `format_d3` is supplied, measures will be formatted with the `humanize` preset)_
- `humanize` — round off numbers in an opinionated way to thousands (K), millions (M), billions (B), etc.
- `none` — raw output
Expand Down

0 comments on commit 4623c95

Please sign in to comment.