<p>Turns out there's a plugin for that. Typography, by nystudio107.</p>
<p><a href="https://nystudio107.com/docs/typogrify/#using-typogrify" rel="nofollow noreferrer">https://nystudio107.com/docs/typogrify/#using-typogrify</a></p>
<p>===== edit =====</p>
<p>I was never able to get this working with typogrify. It never treated a period immediately surrounded by numbers as a decimal point.</p>
<p>It did inspire me to write a plugin, Fractionalize, to provide a '|fractionalize' filter which does the trick.</p>

CC BY-SA 4.0
2021-05-19T05:29:06.313Z
Do you have the Fractionalize plugin available at all. I need something like this right now : )
JKM
CC BY-SA 4.0
2021-05-19T17:25:37.020Z
@JKM Please take it with a grain of salt. Let me know if it breaks anything. https://github.com/extensibleseth/fractionalize
ponies
CC BY-SA 4.0
2021-06-18T02:11:32.340Z
Thanks for this. It really helped me : )
JKM
CC BY-SA 4.0
2020-06-25T19:19:24.663Z
2020-07-17T20:57:29.400Z
2020-07-17T20:57:29.400Z
ponies
<p>Is there a twig filter to display decimal values as fractions?</p>

<templating><filter>
How to display decimals as fractions?
# How to display decimals as fractions?

(Asked by: username_0 on 2020-06-25)

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

**Tags:** templating, filter


---

## 1 answers

### Answer by username_0 on 2020-06-25. Score: 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.

> **Comments:**
> **username_1**: Do you have the Fractionalize plugin available at all. I need something like this right now : )  
> **username_0**: @username_1 Please take it with a grain of salt. Let me know if it breaks anything. https://github.com/extensibleseth/fractionalize  
> **username_1**: Thanks for this. It really helped me : )  

---

