일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- Sring Functions and Operators
- 윈도우
- Tibero
- Data and Time Functions
- HTTP
- String Functions and Operators
- Date and Time Functions
- String Functions and Date Operators
- 방화벽
- 오라클
- String Function and Operators
- 티베로
- Date and Time Function
- 전자정부표준프레임워크
- SVN
- Oracle
- 전자정부 표준프레임워크
- MySQL
- Today
- Total
웹이야기
[MySQL] FORMAT() 본문
MySQL 문자열 함수와 연산자
FORMAT()
-
FORMAT(X, D [,locale])
의 형태
Formats the number X to a format like '#, ###,###.##', rounds to D decimal places, and returns the result as a string. If D is 0, the result has no decimal point or fractional part.
The optional third parameter enables a locale to be specified to be used for the result number's decimal point, thousands separator, and grouping between separators. Permissible locale values are the same as the legal values for the lc_time_names system variable. If no locale is specified, the default is 'en_US'.
mysql> SELECT FORMAT(1232.123456, 4);
+------------------------+
| FORMAT(1232.123456, 4) |
+------------------------+
| 1,232.1235 |
+------------------------+
1 row in set (0.00 sec)
mysql> SELECT FORMAT(1232.123456, 0);
+------------------------+
| FORMAT(1232.123456, 0) |
+------------------------+
| 1,232 |
+------------------------+
1 row in set (0.00 sec)
mysql> SELECT FORMAT(1232.123456, 2, 'de_DE');
+---------------------------------+
| FORMAT(1232.123456, 2, 'de_DE') |
+---------------------------------+
| 1.232,12 |
+---------------------------------+
1 row in set (0.00 sec)
'D > MySQL' 카테고리의 다른 글
[MySQL] HEX() (0) | 2020.04.13 |
---|---|
MySQL FROM_BASE64() (0) | 2020.04.13 |
[MySQL] FIND_IN_SET() (0) | 2020.04.10 |
[MySQL] FIELD() (0) | 2020.04.08 |
[MySQL] EXPORT_SET() (0) | 2020.04.08 |