Is there a twig filter to display decimal values as fractions?


Turns out there's a plugin for that. Typography, by nystudio107.


===== edit =====

I was never able to get this working with typogrify. It never treated a period immediately surrounded by numbers as a decimal point.

It did inspire me to write a plugin, Fractionalize, to provide a '|fractionalize' filter which does the trick.

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.