Has anyone used the format() function in the expression builder?

The definition states it require arguments. just playing around with it but cant find too much on this function so i am not sure on its actual use/output/argument requirements.

  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. Rather than asking "Has anyone used the format() function in the expression builder?", I think you should report what happened when you tried to use it, and if you got stuck, then any errors, etc that you observed. – PolyGeo Jul 20 '17 at 4:10
  • Hi thanks for the reply and advice. unfortunately there is nothing to report as well have no idea where to start. Just looking for a little hint or detail on what it actually does or what it needs to work. Just to point me in right direction then I can go off and play around with it. Most of the other functions I understand and can crack this has stumped me and. Am struggling to find any info on it. I am guessing it's not used much. – Rollobluster Jul 20 '17 at 7:48
  • Where did you come across it? For example, a link to any mention of it in any documentation, or some instructions on how to find it in the GUI. – PolyGeo Jul 20 '17 at 7:54

This is the help text in Field calculator:

function format
Format a string using supplied arguments.

format(string, arg1, arg2, ...)

A string with place holders for the arguments.
Use %1, %2, etc for placeholders.
Placeholders can be repeated.
any type. Any number of arguments.

format('This %1 a %2','is', 'test')
→ 'This is a test'
| improve this answer | |
  • Sorry about the delay in response. much appreciated for your response i will check it out and play around. And will see how useful this can be. – Rollobluster Jul 26 '17 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.