New to Telerik Document ProcessingStart a free 30-day trial

Format Codes

Updated on Jun 16, 2026

RadSpreadProcessing allows you to control the appearance of number values through Number Formats. A variety of predefined formats exist, and you can define a custom format if they do not suit your scenario. The following sections explain how to use format codes to create your own number format or modify one of the predefined types. For more information about the predefined types, see the Number Formatting article.

Overview

A number format can contain up to four sections. Each section defines a format for different values as shown in Figure 1.

Figure 1: Number format sections

Number format sections diagram

These sections are not required and can be omitted. If only one section is specified, its code is used for all numbers. If two sections are specified, the first one is used for positive numbers and zeros and the second one for negative numbers.

If a number format is not explicitly set, the default format is General. It represents an empty string, which provides default behavior for the different types of values.

Format with Text Values

You can display a combination of text and numbers in a cell by enclosing the text in the format string in double quotation marks. If it is a single character, you can precede it with a backslash (''). The '@' sign is useful when you need to include text typed by the user in the cell.

Table 1

Number Format CodeValueResult
$ 0.00" Salary"345$ 345.00 Salary
$ –0.00" Monthly expenses"50$ -50 Monthly expenses
"Invoice for "@electricityInvoice for electricity

If the format code consists only of an ‘@’ sign, the value in the cell will be visualized as it is typed.

Some characters like the percentage sign (%) do not require quotation marks when you include them in a format code. The following table lists them.

Table 2

$+- (Minus sign)/():!^
&`~{}<>= (Space character)

Decimal Places and Spaces

With the number sign (#) you can display only the significant digits in a number. To display non-significant zeros when a number consists of fewer digits than specified in the format code, use the numerical character for zero (0).

Table 3

Number Format CodeValueResult
####.#124.49124.5
#.0001.21.200
0.#.3210.3
#.0#1111.0
123.456123.46
# ???/???1.251 1/4
2.52 1/2
#,###1200012,000
#,1200012
000001200012
123401234
"000"#1200012
12340001234

Colors and Conditions

Colors

With the number format codes you can specify the color of a section in the format code. There are eight colors available:

  • Black

  • Blue

  • Cyan

  • Green

  • Magenta

  • Red

  • White

  • Yellow

The name of the color must be defined as the first item in a section and enclosed in square brackets.

Conditions

The number formats can be applied according to conditions. Each condition is enclosed in square brackets and consists of a comparison operator and a value. For example, the following number format displays numbers less than or equal to 50 in a red font and numbers greater than 50 in a blue font.

[Red][<=50];[Blue][>50]

Currency, Percentages, and Scientific Notation

Adding a currency symbol to a number format displays numbers as monetary values.

Table 4: Currencies

Number Format CodeValueResult
$#,##01234$1,234
#,##0 лв.12341,234 лв.

The Currency format is influenced by your OS regional settings. For more information, go to Localization.

Adding a percent sign (%) in the number format displays numbers as a percentage of 100.

Table 5: Percentage

Number Format CodeValueResult
0%0.055%
Format negative percentage
0.00%;[Red]-0.00%-0.123-12.30%

Using one of the exponent codes (E–, E+, e–, or e+) in the number format code displays numbers in scientific notation.

Table 6: Scientific

Number Format CodeValueResult
0.00E+001234567891.23E+08
-1234.56789-1.23E+03
0.1234567891.23E-1
0.00e-001234567891.23E08

Date and Time Formatting

The following table lists the format codes for date and time:

Table 7

Number Format CodeValueResult
yyYears00-99
yyyyYears1900-9999
mMonths1-12
mmMonths01-12
mmmMonthsJan-Dec
mmmmMonthsJanuary-December
mmmmmMonthsJ-D
dDays1-31
ddDays01-31
dddDaysSun-Sat
ddddDaysSunday-Saturday
hHours0-23
hhHours00-23
mMinutes0-59
mmMinutes00-59
sSeconds0-59
ssSeconds00-59
h AM/PMTime6 AM
h:mm AM/PMTime6:15 PM

The Date and Time formats are influenced by your OS regional settings. For more information, go to Localization.

Localization

Your regional settings influence how date/time and currency data types appear when you apply formatting options. You can control these settings from Region & language settings (for Windows) or Language & Region (for Mac).

The regional currency settings determine the position of the currency symbol relative to the number, the decimal symbol, and the thousands separator. The regional settings also determine the appearance of the date/time data types.

Table 8: Examples

RegionFormatResult
English (US)Long date format:dddd, MMMM d, yyyy
Long time:h:mm:ss tt
English(UK)Long date format:dd MMMM yyyy
Long time:HH:mm:ss

See Also