> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Format columns and metrics in the code representation of a data model

> Format numbers and dates in Sigma data model code representations to control how columns and metrics appear for users in the Sigma UI.

You can apply formatting to numbers and dates that appear in columns and metrics when [creating or managing a data model from code](/docs/manage-data-models-as-code). Formatting allows you to customize the appearance of dates and numbers for users in the Sigma UI, including decimal and currency symbols, prefixes and suffixes, the order of day, month, and year in dates, and more.

For more information on custom number and date formatting in Sigma, see [Custom number format](/docs/data-types-and-formats#custom-number-format) and [Define custom datetime formats](/docs/define-custom-datetime-formats).

## Example representation with formatting

The following example shows a JSON representation of a data model with a two formatted columns, as well as a formatted metric:

#### Full JSON representation with formatting

```json
{
  "dataModelId": "bee54be7-da4b-4f06-ae39-5d9f20ca6448",
  "name": "format",
  "url": "https://aws-api.sigmacomputing.com/org-name/data-model/format-vSe2OD0G5CufXNlFsUBMG6",
  "documentVersion": 2,
  "latestDocumentVersion": 2,
  "ownerId": "nbUSLu9CWT8PHqRGRtRnqB9Qpd2ft",
  "folderId": "355f8dfa-dd9d-4367-812a-1a4ca1a56af9",
  "createdBy": "nbUSLu9CWT8PHqRGRtRnqB9Qpd2ft",
  "updatedBy": "nbUSLu9CWT8PHqRGRtRnqB9Qpd2ft",
  "createdAt": "2026-04-09T18:29:57.220Z",
  "updatedAt": "2026-04-09T18:50:58.660Z",
  "schemaVersion": 1,
  "pages": [
    {
      "id": "k5gBRMjdB6",
      "name": "Page 1",
      "elements": [
        {
          "id": "lJxUgyIuqg",
          "kind": "table",
          "source": {
            "connectionId": "c8c0c5b8-92e5-44c5-97bb-63a54ea2579e",
            "kind": "warehouse-table",
            "path": [
              "EXAMPLES",
              "PLUGS_ELECTRONICS",
              "PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA"
            ]
          },
          "columns": [
            {
              "id": "inode-MLxsSmqvIqKr3rvUuyIgET/DATE",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Date]",
              "format": {
                "kind": "datetime",
                "formatString": "%a, %b %d, %Y"
              }
            },
            {
              "id": "zhwYxC7Fli",
              "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Price]",
              "format": {
                "kind": "number",
                "formatString": "$.2f",
                "decimalSymbol": ".",
                "digitGroupingSymbol": ",",
                "digitGroupingSize": [
                  3
                ],
                "currencySymbol": "$"
              }
            }
          ],
          "metrics": [
            {
              "id": "4tmns500B9",
              "formula": "Sum([Price])",
              "name": "Total Sales",
              "format": {
                "kind": "number",
                "formatString": "$.2f",
                "decimalSymbol": ".",
                "digitGroupingSymbol": ",",
                "digitGroupingSize": [
                  3
                ],
                "currencySymbol": "$"
              }
            }
          ],
          "order": [
            "inode-MLxsSmqvIqKr3rvUuyIgET/DATE",
            "zhwYxC7Fli"
          ]
        }
      ]
    }
  ]
}
```

## Representing column formatting

In this example, two columns are formatted:

* The *Date* column is formatted with the custom date format string `%a, %b %d, %Y`
* The *Price* column is formatted with the custom number format string `$.2f`.

#### Column formatting representation

```json
...
[
  {
    "id": "inode-MLxsSmqvIqKr3rvUuyIgET/DATE",
    "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Date]",
    "format": {
      "kind": "datetime",
      "formatString": "%a, %b %d, %Y"
    }
  },
  {
    "id": "zhwYxC7Fli",
    "formula": "[PLUGS_ELECTRONICS_HANDS_ON_LAB_DATA/Price]",
    "format": {
      "kind": "number",
      "formatString": "$.2f",
      "decimalSymbol": ".",
      "digitGroupingSymbol": ",",
      "digitGroupingSize": [
        3
      ],
      "currencySymbol": "$"
    }
  }
]
...
```

## Representing metric formatting

In this example, the `Total Sales` metric is formatted with the custom number format string `$.2f`.

#### Metric formatting representation

```json
...
[
  {
    "id": "4tmns500B9",
    "formula": "Sum([Price])",
    "name": "Total Sales",
    "format": {
      "kind": "number",
      "formatString": "$.2f",
      "decimalSymbol": ".",
      "digitGroupingSymbol": ",",
      "digitGroupingSize": [
        3
      ],
      "currencySymbol": "$"
    }
  }
]
...
```