Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Format Metrics in WFO Reports

Use the Number format editor to configure how numbers appear in your reports. You can round numbers, accommodate regional settings, add currency symbols, adjust colors, or append numbers with sets of characters.

Access the number format editor

To access the Number format editor, click Edit in the Detail column of a metric.

Metric Format

Then apply formatting syntax in the custom number formats field.

Number_format_editor.png

Samples

You can use built-in templates for number formatting, or any of the examples below by copy-pasting this sample code directly into your number format editor:

Raw integer number:

0

Natural integer with thousand separators such as 1,234 or 12,345,678 :

#,##0

One decimal number with thousand separators (1,234.5):

#,##0.0

Two decimal number with thousand separators (1,234.56):

#,##0.00

Large numbers

This shortens large numbers and makes them easier to read – for example, 4.6B5.8M, 145.4K . Numbers below one thousand are shown as exact integers.

General purpose large number:

[>=1000000000]#,,,.0B;
[>=1000000]#,,.0M;
[>=1000]#,.0K;
[>=0]#,##0;
[<=-1000000000]-#,,,.0B;
[<=-1000000]-#,,.0M;
[<=-1000]-#,.0K;
[<0]-#,##0

Duration

Duration format will take a number (in seconds) and show it in hours, minutes and seconds.
Duration in hours will look like 1h 23:45 or 12:34 when shorter than one hour.

[>=3600]{{{3600||#}}}h {{{60|60|00}}}:{{{|60|00}}};
[>=0]{{{60|60|00}}}:{{{|60|00}}};
[<0]-{{{60|60|00}}}:{{{|60|00}}};

Percentages

Percentages convert numbers in the range 0.0 to 1.0 into the more natural percentage format 0% to 100% . Use the below samples for the format you need.

Integer percentages:

0%

One decimal percentages:

0.0%

Two decimals percentages:

0.00%

Colors

You can use web colors to change the text and background color in your WFO tables. You can use HTML color codes to adjust your colors.

You may wish to use the same color with the same measure to help your users quickly identify the measure. Or you can combine colors with conditional formatting to can change color depending on the value of a measure.

The example below shows how to set the same color for the measure text, in any situation:

[color=fecdd2]0;

The example below shows how to change the background cell color of a measure.

[backgroundcolor=fecdd2][color=b71c1c]0;

Conditional formatting

You can show different number formats depending on the value of the measure. This allows you to easily show positive/negative number differently or handle special cases.

To format numbers, set your conditions in square brackets followed by the format and separated by a semicolon from the next format. The first condition that matches will be used. We recommend that you include a default value at the very end.

The following example shows how to display dash when there is no value for the metric.

[=null]—;
0

The example below shows that you can use custom text instead of the original value like the "zero" in the example below.

[=null]—;
[>0]0;
[=0]zero;
(0)

When you use conditions for percentage measures such as Abandoned Conversations % or Silence %, use decimal numbers instead of percents, e.g., use 0 instead of 0% and 1 instead of 100%. The example below shows a condition for more than 10% and more than 5%.

[>0.1]Over ten percent;
[>0.05]Over five percent;
Under five percent

When you use conditions for duration measures such as Talk Time or Activity Time, use seconds in the conditions.

The example below shows a condition for one hour (3600 seconds) and a condition for one minute (60 seconds).

[>3600]Over one hour;
[>60]Over one minute;
Under one minute

For more advanced number formatting techniques, please see the following articles:

Formatting Numbers in Reports

Conditional Number Formatting

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.