New versions: Dev (3.15)

DIGITS

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The DIGITS() function allows for turning numbers to 0-padded string that makes sorting those strings according to numeric values easier when concatenated to other strings. The padding depends on the number's data type, precision, and scale.

SELECT digits(cast(1234.5 as decimal(8, 2)));
create.select(digits(cast(val(1234.5), DECIMAL(8, 2)))).fetch();

The result being

+----------+
| digits   |
+----------+
| 00123450 |
+----------+

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo