Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Numeric format strings - Amazon Redshift

Numeric format strings

Following, you can find a reference for numeric format strings.

The following format strings apply to functions such as TO_NUMBER and TO_CHAR.

  • For examples of formatting strings as numbers, see TO_NUMBER.

  • For examples of formatting numbers as strings, see TO_CHAR.

Format Description
9 Numeric value with the specified number of digits.
0 Numeric value with leading zeros.
. (period), D Decimal point.
, (comma) Thousands separator.
CC Century code. For example, the 21st century started on 2001-01-01 (supported for TO_CHAR only).
FM Fill mode. Suppress padding blanks and zeroes.
PR Negative value in angle brackets.
S Sign anchored to a number.
L Currency symbol in the specified position.
G Group separator.
MI Minus sign in the specified position for numbers that are less than 0.
PL Plus sign in the specified position for numbers that are greater than 0.
SG Plus or minus sign in the specified position.
RN Roman numeral between 1 and 3999 (supported for TO_CHAR only).
TH or th Ordinal number suffix. Does not convert fractional numbers or values that are less than zero.
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.