New to Telerik Document ProcessingStart a free 30-day trial

Format Codes

Updated on Jan 1, 2026

RadSpreadProcessing allows to control the appearance of the number values using Number Formats. There is a variety of predefined formats and you can define a custom one in case they are not suitable for your scenario. This article explains how to use the codes in order to create your own number format or modify one of the predefined types. More information about the predefined types can be found in Number Formatting article.

Overview

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

Figure 1: Number format sections

These sections are not required and could be omitted. If only one section is specified, its code is used for all numbers. In case the specified sections are two, 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 one is General. It represents an empty string, which has a default behavior for the different types of values.

Format With Text Values

You could display a combination of text and numbers in a cell by enclosing the text in the format string in double quotation marks or, if it is a single character, you could precede it with a backslash (‘\’). The ‘@’ sign is useful when you need to include a text typed from 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 using quotation marks when including them in a format code. They are listed in Table 2.

Table 2

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

Decimal Places and Spaces

With the number sign (#) you could display only the significant digits in a number. In order to display non-significant zeros when a number consist of fewer digits than the specified in the format code you could 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 could 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 will display numbers that are less than or equal to 50 in a red font and numbers that are greater than 50 in a blue font.

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

Currency, percentages, and scientific notation

Adding a currency symbol to a number format helps to display numbers as monetary value.

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 helps to display 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 helps to display numbers in scientific notation. The number after the exponent code (if any) displays the number 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 format codes about date and time are listed in the following table:

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 will influence how your 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 as well as 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