format

LookML
Version

On this Page
Docs Menu

Go to Field Parameter List

Definition

As of release 3.16, use value_format instead of format.

The format parameter allows you to format Looker cells using printf-style formats. For example:

- measure: total_order_amount type: sum sql: ${order_amount} format: '$%.2f'

You can read Ruby’s guide about how to specify these formats in their documentation. However, please note that printf’s justification modifiers and minimum-width modifiers are not supported in Looker. Also, please note that decimal places specified in format override the decimals parameter.

Some of the most common formatting options are shown here:

format: '%.2f%' # Percent with 2 decimals format: '$%.2f' # Dollar sign with 2 decimals format: '%.1f' # Floating point number rounded to one decimal place format: '%d' # Integer format: '%09d' # Integer zero-padded to minimum 9 characters format: '%x' # Conversion of integer to hexadecimal format: '%05.2f%' # Percent with 2 places before and after the decimal (01.23%) format: 'The value is: %f!' # (The value is: 123.45678!)

Still have questions?
Go to Discourse - or - Email Support
Top