Integer to string with leading zeroes

I would like to convert a property of nodes which is a integer to a string. I would use the toString()-function for that, but I need to convert them to a fixed length of the string. So there are some leading zeroes which need to be included in the string.

123 -> "123"
12 -> "012"
1 -> "001"

Is there any option for that in Cypher or Apoc?

Thank you,


yes.. for example

 return apoc.text.lpad('1', 3, '0')

results in



 return apoc.text.lpad('123', 3, '0')

results in


see apoc.text.lpad - APOC Documentation for more details

Thank you, very much appreciated!