1

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

1

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

https://nystudio107.com/docs/typogrify/#using-typogrify

===== 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.

| improve this answer | |

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.