ConradBI home

Home  /  How-to  /  Model your data

Custom number and date formats

Show every number and date the way your business reads it, with a pattern you write yourself.

The short version

  • A pattern says how a number is written: #,##0.00 writes 1234.567 as 1,234.57.
  • Set Format to Custom and type the pattern in Pattern. That works on a measure, a DAR-C calculation, a tooltip line and a reference line.
  • In DAR-C, .Format("#,##0.0") just before .Return() does the same. In Hu++, TEXT([Units], "#,##0") and {[Units]:#,##0} write a value as text.
  • Up to three parts, split by ;, cover positive numbers, negative numbers and zero: $#,##0;($#,##0);"–".
  • A comma just before the decimal point divides by a thousand: #,##0,.0"K" writes 987654.3 as 987.7K.
  • Dates use letters: MMM d, yyyy writes March 14, 2026 as Mar 14, 2026.
Back to How-to guides
In this guide
  1. What a pattern is
  2. Where you can use one
  3. Your first pattern: revenue in dollars
  4. The pattern characters
  5. Negative numbers and zero
  6. Thousands and millions
  7. Percentages
  8. Currency signs and units
  9. In DAR-C and Hu++
  10. Dates
  11. What doesn't work as in Excel
  12. Regional settings
  13. When something goes wrong
  14. Recipes

What a pattern is

The ready-made formats, Number, Decimal, Currency and Percent, cover the usual cases. When you need something else, such as a euro sign, negatives in brackets or sales in thousands, you write a pattern: a short template that shows where the digits go.

In #,##0.00, each 0 is a digit that is always written, # is a digit written only when it is needed, the comma groups the thousands and the point is the decimal point. Anything you put in quotes is written as it is. Excel uses the same kind of pattern, with a few differences, listed in What doesn't work as in Excel.

The examples in this guide use the Sales model of the other guides, and show what each pattern writes for a given value.

Where you can use one

Where How
A measure on a fact In the Measures grid, set the measure's Format to Custom and type the pattern in Pattern
A DAR-C calculation on a fact or a visual Set its Format to Custom, or end the calculation with .Format("pattern") before .Return()
A line on a visual's Tooltip tab The line's Format
A reference line The line's Format
Text you build in Hu++ TEXT(value, "pattern"), or {value:pattern} inside a $"…" text

A format only changes how a value is written. The number underneath stays the same, so totals, sorting and filters work on the real value. A measure's format travels with it to every visual that uses it.

Your first pattern: revenue in dollars

  1. Open the Sales fact.
  2. In the Measures grid, find the Revenue row and set Format to Custom. A Pattern box appears beside it.
  3. Type $#,##0.
  4. Process the fact, then open a visual that shows Revenue, such as Revenue by Region.

What you see: each value with a dollar sign, commas and no cents. A revenue of 1234.567 reads $1,235.

Tip: Keep the cents with $#,##0.00. The value rounds to the decimal places the pattern shows.

The pattern characters

Character What it does Example
0 A digit, or a zero when there is none 000000 writes 1234.567 as 001235
# A digit, only when it is needed 0.## writes 1234.5 as 1234.5
. The decimal point 0.00 writes 1234.567 as 1234.57
, between digits Groups the thousands #,##0 writes 1234.567 as 1,235
, just before the point, or at the end Divides by a thousand, once for each comma #,##0,"K" writes 987654.3 as 988K
% Multiplies by 100 and writes the % sign 0.0% writes 0.4235 as 42.4%
‰ Multiplies by 1,000 and writes the ‰ sign 0‰ writes 0.0123 as 12‰
E+0 Scientific notation 0.00E+0 writes 1234567.89 as 1.23E+6
"text" or 'text' Written as it is #,##0 "units" writes 1234.567 as 1,235 units
\ Writes the next character as it is \$#,##0 writes 12 as $12
; Separates the parts for positive numbers, negative numbers and zero See Negative numbers and zero

Any other character, such as $, €, a space or a dash, is written as it is.

Negative numbers and zero

A pattern can have up to three parts, separated by semicolons: the first for positive numbers, the second for negative numbers, the third for zero.

Pattern Positive Negative Zero
#,##0 1,235 -1,234 0
#,##0.00;(#,##0.00) 1,234.57 (45.00) 0.00
$#,##0;($#,##0);"–" $1,235 ($1,234) –
+#,##0;-#,##0;0 +1,235 -1,234 0
  • With one part, a negative number gets a minus sign in front.
  • With a second part, a negative number is written without its minus sign, so the part says how to show it: in brackets, with a minus sign of its own, or in words.
  • The third part is for a value of exactly zero, such as a dash or "none".
  • A plus sign on increases, +#,##0;-#,##0;0, suits a change from last year.

Thousands and millions

A comma just before the decimal point, or at the end of the pattern, divides the number by a thousand. Two commas divide by a million. Add the letter yourself, in quotes.

Pattern Value Shows
#,##0,"K" 987654.3 988K
#,##0,.0"K" 987654.3 987.7K
#,##0,,.0"M" 1234567.89 1.2M
$#,##0,,.00"M" 1234567.89 $1.23M

The comma goes before the point, not after the decimals. Excel lets you write #,##0.0,"K". Here a comma after the decimals divides nothing, so that pattern writes 1234.567 as 1,234.6K. Write #,##0,.0"K" instead.

On a chart or a card, decide who shortens the numbers. A Bar Chart and a Multi Axis Line Graph shorten their axis by themselves: Axis unit set to Auto picks K, M or B, then writes the shortened number with your pattern. A Card's Unit does the same for its figure. A pattern that divides by a thousand on top of that gives numbers that make no sense, so for a measure whose pattern shortens, set Axis unit or Unit to None. For a pattern that doesn't, such as $#,##0.00, leave Auto, and the axis reads $1.25K.

Percentages

% multiplies by 100, as Percent does with ×100 ticked.

Pattern Value Shows
0% 0.4235 42%
0.0% 0.4235 42.4%
0.000% 0.12345 12.345%
0.0"%" 42.35 42.4%

When the value is already a percentage, such as 42.35, put the sign in quotes, 0.0"%". In quotes it is only written, not multiplied.

Currency signs and units

The Currency format always writes a dollar sign. For any other sign, write it into a pattern:

Pattern Value Shows
€#,##0.00 1234.567 €1,234.57
£#,##0 1234.567 £1,235
#,##0 "units" 1234.567 1,235 units
0.0"x" 3.456 3.5x

In DAR-C and Hu++

In DAR-C, Format sets how a calculation's result is shown, wherever it appears. It goes once, just before .Return(), and wins over the calculation's Format box:

DAR-C
.Context.Value().AggregateFact(Sum, Revenue).Format("$#,##0").Return();

Format also takes a kind and its decimal places, after a comma: .Format(Percent, 1). A calculation that returns text can't have one, because a format only shapes a number. See the DAR-C reference.

In Hu++, a format writes a value as text: TEXT(value, "format"), or {value:format} inside a $"…" text. It takes a pattern, or a kind with its decimal places after a space, such as Currency 0 or Percent 1:

Hu++
$"{[Units]:#,##0} units, {[Revenue]:Currency 0}"
Hu++
TEXT([Order Date], "MMM yyyy")

With 1235 units and a revenue of 1234.567, the first writes 1,235 units, $1,235. For an order date of March 14, 2026, the second writes Mar 2026. See Text and numbers in the Hu++ guide.

Tip: Inside a DAR-C or Hu++ text, write literal words in single quotes, 'units', so they don't end the text early.

Dates

Dates use letters instead of digits. You meet date patterns in three places: the formats a Format Date step and a Date Dimension's Date format offer, which you pick from a list (see The date format), and the patterns you type yourself in Hu++.

For March 14, 2026 at 1:05:09 in the afternoon:

Letters Shows
yyyy / yy 2026 / 26
MMMM / MMM / MM March / Mar / 03
dddd / ddd / dd Saturday / Sat / 14
HH / h / tt 13 / 1 / PM
mm / ss 05 / 09
Pattern Shows
yyyy-MM-dd 2026-03-14
MM/dd/yyyy 03/14/2026
MMM d, yyyy Mar 14, 2026
dddd, MMMM d, yyyy Saturday, March 14, 2026
MMM yyyy Mar 2026
h:mm tt 1:05 PM
'Week of' MMM d Week of Mar 14

Two traps:

  • MM is the month and mm is the minutes. yyyy-mm-dd writes the minutes in the middle: 2026-05-14.
  • A single letter on its own means a whole ready-made format. d alone writes 3/14/2026, and M alone writes March 14. For just the day or the month number, write %d or %M.

What doesn't work as in Excel

ConradBI reads a pattern much as Excel does, but a few Excel codes are written out as text instead:

  • Colors and conditions, such as [Red], [Blue] or [>1000]. [Red]#,##0 writes [Red]1,235. To color values, use the visual's Color tab, as Colors and visual defaults explains.
  • Spacing and fill codes, _ and *. #,##0_) writes 1,235_).
  • The text code @, and a fourth part for text, which is left out.
  • A thousands comma after the decimals. See Thousands and millions.

Regional settings

In a pattern, the point is always the decimal point and the comma always groups the thousands. What a reader sees follows the regional settings of the computer that draws the visual, so on a German computer #,##0.00 writes 1234.567 as 1.234,57.

Hu++ is the exception. It always writes the US way, 1,234.57, so text built in a prep reads the same whichever computer runs it.

When something goes wrong

What you see What to do
1,234.6K for a value of 1234.567 The comma is after the decimals and divides nothing. Write #,##0,.0"K"
An axis or a card with numbers that make no sense, such as 0.0KM The pattern shortens the number, and so does the visual. Set Axis unit, or a Card's Unit, to None
A percentage 100 times too big, such as 4235% The value is already a percentage. Write the sign in quotes: 0.00"%"
[Red], _) or * in the number An Excel code that ConradBI writes as text. Take it out. See What doesn't work as in Excel
The number shows plainly, as if it had no format The pattern can't be read. Check it against the pattern characters
A date shows the minutes where the month should be Write MM for the month. mm is minutes
d gives a whole date A single letter is a ready-made format. Write %d for the day
"… isn't a format: a kind — Number, Decimal, Currency or Percent, with its decimal places after a space — or a pattern …" A Hu++ format must be a kind, such as Currency 0, or a pattern that fits the value: a number pattern for a number, a date pattern for a date
A dollar sign where you need another currency Set Format to Custom and write the sign in the pattern: €#,##0.00

Recipes

To show Pattern Example
A whole number with commas #,##0 1234.567 → 1,235
Two decimal places #,##0.00 1234.567 → 1,234.57
Dollars without cents $#,##0 1234.567 → $1,235
Euros €#,##0.00 1234.567 → €1,234.57
Negatives in brackets $#,##0;($#,##0) -1234.44 → ($1,234)
A plus sign on increases +#,##0;-#,##0;0 1234.567 → +1,235
A dash for zero #,##0;-#,##0;"–" 0 → –
Thousands #,##0,.0"K" 987654.3 → 987.7K
Millions $#,##0,,.00"M" 1234567.89 → $1.23M
A fraction as a percentage 0.0% 0.4235 → 42.4%
A percentage that is already one 0.0"%" 42.35 → 42.4%
A unit after the number #,##0 "units" 1234.567 → 1,235 units
Leading zeros 000000 1234.567 → 001235
Scientific notation 0.00E+0 1234567.89 → 1.23E+6

Missing something?

Tell us what you were trying to do and what this guide didn't answer. We update it with every release.

Write to us

What changed in this guide

  • November 21, 2026: First edition, written for ConradBI 1.2.59.