Hi,
Does anyone know the expression for adding leading zeros to a number? (i.e. convert 1 to 001 and 12 to 012).
I've done this before, but can't remember the expression or find it in the user guide.
At the moment I have a string so my partial expression is value.toNumber()
Thanks, Graham
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/CWXP265MB2951FA140FA21BC70B7899E382C29%40CWXP265MB2951.GBRP265.PROD.OUTLOOK.COM.
value.toString("%.0f")
to a column:To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/d88abea6-6bf9-4289-aa05-663f49e311e6n%40googlegroups.com.
In our docs here GREL functions | OpenRefine we provide a link as shown below to the Formatter class which fully describes all the options available to use.
--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/4fc5d28c-3b71-4196-b489-700bed38b624n%40googlegroups.com.
Thanks Thad, Owen, Parthasarathi
("%.0f")
is exactly the expression I was looking for. I didn’t think to consider it would be related to .toString.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/CAChbWaOB44WghbNN-qdMqs0iD%2BrY30H_DMUESQgniTvap0sMPQ%40mail.gmail.com.