Returns a formatted string using the specified printf string and arguments.
:::tip This function is supported since version 3.0.6. :::
PRINTF(<format>, [<args>, ...])
| Parameter | Description |
|---|---|
<format> | The printf format string. |
<args> | The arguments to be formatted. |
The formatted string using a printf mode.
select printf("hello world");
+-----------------------+ | printf("hello world") | +-----------------------+ | hello world | +-----------------------+
select printf('%d-%s-%.2f', 100, 'test', 3.14);
+-----------------------------------------+ | printf('%d-%s-%.2f', 100, 'test', 3.14) | +-----------------------------------------+ | 100-test-3.14 | +-----------------------------------------+
select printf('Int: %d, Str: %s, Float: %.2f, Hex: %x', 255, 'test', 3.14159, 255);
+-----------------------------------------------------------------------------+ | printf('Int: %d, Str: %s, Float: %.2f, Hex: %x', 255, 'test', 3.14159, 255) | +-----------------------------------------------------------------------------+ | Int: 255, Str: test, Float: 3.14, Hex: ff | +-----------------------------------------------------------------------------+