I have a fraction and I want to display it neatly and nicely.
For example
4/5
would be
4
-
5
I have looked at this and
This does not automatically convert '1/2' to a fraction form. But if you have more control over the templating, you can do the following. Since no one has suggested using a table yet, here goes:
HTML:
Top of Fraction
Bottom of Fraction
CSS:
table.fraction {
display: inline-block;
text-align: center;
margin-left: 1em;
}
table.fraction td {
line-height: 2em;
}
table.fraction td.top {
border-bottom: 1px solid darkgray;
}
Result: