photools.com Community

IMatch Bug Reports and Feature Requests => Feature Requests => Archive (Feature Requests) => Topic started by: Jean-Maetso on September 16, 2014, 10:55:18 AM

Title: Formatting functions: limiting the length of the output
Post by: Jean-Maetso on September 16, 2014, 10:55:18 AM
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
Title: Re: Formatting functions: limiting the length of the output
Post by: Mario on September 16, 2014, 12:45:29 PM
You can use the substr function to extract a certain maximum of characters.
Title: Re: Formatting functions: limiting the length of the output
Post by: Jean-Maetso on September 16, 2014, 02:46:27 PM
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