And on my site, I do indeed get the desired result - .e.g. 12%
But what surprises me is when I look in the content manager the ‘femalePercent’ now shows with % (together with an ! " The value does not match the field type Number". ), instead of just an interger.
Is this expected behaviour? I only expected the query hook to only apply on the client-side , not when viewing the data in the content manager.
I don’t think it does any harm but maybe you’d prefer to use different field names, so it’ll look OK when you load the content manager. something like:
Yes, that is a good solution for many situations but some plugins such as the Pro Galleries seem only to be able to access the collection’s fields, not ones generated in JS.