is it currently possible to format values in a template according to certain rules like in printf (and similar) functions in other languages? I read the documentation for both Template and Number and Date Formatting and the closest thing to what I’d like is the #variable# syntax in the template property of views. It is too basic, though.
What I need is a function that formats the values so that I can pad them left or right, define whether they’re presented as integers, floats or strings, set a precision and so on. Something like this, for example (formats is my own function that I made and use until I find another way):
Thanks, Helga. I already looked at i18n but could not manage to use it as I want to.
Let’s consider the following scenario: I have a list with shop articles. The articles have names and prices. If I want to display the name with the price in brackets, I’d use #name# (#price# €) as the template, right? Can I use i18n to format the price accordingly in this scenario? If yes, how?
Oh. I even used that in the past, I just didn’t think of it. I’m sorry I took your time for such a trivial thing.
Besides that, did you ever think about providing a syntax like what I searched that would allow you to use a string instead of a function for this type of simple template?