[QGIS-Developer] QGIS expression: Formatting numbers with leading zeros

Neumann, Andreas a.neumann at carto.net
Wed Jul 12 01:02:35 PDT 2017


Hi, 

Is there a way in a QGIS expression to format numbers with leading zeros
up to n places before the decimal point? E.g. 1 should be 00001, 10
should be 00010, etc. 

I would need this for correct sorting. 

I know, I could probably write a python expression, or something
complicated with CASE WHEN, but I'd like to avoid that. 

Perhaps something is already existing? 

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170712/1bbaad09/attachment.html>


More information about the QGIS-Developer mailing list