Product Solutions Support
Try MemSQL

FORMAT

Rounds and formats a number with thousands separators and a fixed-length decimal part.

FORMAT ( expression, precision )

Arguments

Return Type

String. The thousands separator is hard-coded to ”,” and the decimal separator is ”.”

Examples

memsql> select format(1234.565, 2);
+---------------------+
| format(1234.565, 2) |
+---------------------+
| 1,234.57            |
+---------------------+

memsql> select format(1234.56499, 2);
+------------------------+
| format(1234.561499, 2) |
+------------------------+
| 1,234.56               |
+------------------------+

memsql> select format(1234.567, 0);
+---------------------+
| format(1234.567, 0) |
+---------------------+
| 1,235               |
+---------------------+
Was this article useful?