Skip to main content

Field formatting

Passing the value_format_name parameter to your field lets you easily format values in a way that's easy to read for business users.


Options#

There are several options. Broadly speaking, there is a format type followed by a number of decimal places. For example, decimal_1 formats the number like a decimal and rounds to one decimal place.

Value Format NameUnformatted ValueFormatted Value
decimal_012345.67812,346
decimal_112345.67812,345.7
decimal_212345.67812,345.68
decimal_pct_03.4563%
decimal_pct_13.4563.5%
decimal_pct_23.4563.46%
percent_00.345635%
percent_10.345634.6%
percent_20.345634.56%
eur12345.678€12.3k
eur_012345.678€12,346
eur_112345.678€12,345.7
eur_212345.678€12,345.68
usd12345.678$12.3k
usd_012345.678$12,346
usd_112345.678$12,345.7
usd_212345.678$12,345.68

Examples#

Here's an examples of a field with value_format_name as a property.

- name: avg_price  field_type: measure  type: average  sql: ${price}  value_format_name: usd