FORMAT
Descriptionβ
Returns a formatted string using the specified format string and arguments:
Syntaxβ
FORMAT(<format>, <args> [, ...])
Parametersβ
Parameter | Description |
---|---|
<format> | The value is to be format mode |
<args> | The value is to be format within string |
Return Valueβ
The formatted string using a format mode.
Exampleβ
select format("{:.5}",pi());
+-----------------------+
| format('{:.5}', pi()) |
+-----------------------+
| 3.1416 |
+-----------------------+
select format("{:08.2}",pi());
+-------------------------+
| format('{:08.2}', pi()) |
+-------------------------+
| 000003.1 |
+-------------------------+
select format("{0}-{1}","second","first");
+--------------------------------------+
| format('{0}-{1}', 'second', 'first') |
+--------------------------------------+
| second-first |
+--------------------------------------+