Formatting functions: limiting the length of the output

Started by Jean-Maetso, September 16, 2014, 10:55:18 AM

Previous topic - Next topic

Jean-Maetso

Hello,
First thanks to Mario for his support when I noticed that the "limit:" formatting function was not doing its job correctly. I am waiting for the next build!

In the same vein, I would be happy to have a similar filter that puts a limit on the output, not in the number of of items, but in the number of characters; something like:
{File.Categories|maxlength:30} limits the result to 30 characters, whatever this makes place for 2 or 3 or "4and a half" categories ...

Hope the request is clear enough, and not too tricky to implement (I can't see how it could be...)
Regards,
JM

Mario

You can use the substr function to extract a certain maximum of characters.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jean-Maetso

Oh, right, there is a "substr" formatting function.... which obviously makes the deal.
I should have re-read the Help before thinking and issuing my post :(
Thanks