Search This Blog

Saturday, April 12, 2008

Fractions in HTML and Unicode

Not a food post, but about computer issues relating to recipes.

I haven't been consistent about this, but sometimes I try to put vulgar fractions into recipes as individual characters, rather than digits separated by a "/". It looks better, but I wonder if everyone sees them correctly.

Only three vulgar fractions are in ISO-Latin-1, so they have their own HTML codes:
¼ (1/4, HTML ¼)
½ (1/2, HTML ½)
¾ (3/4, HTML ¾)
I assume those work fine for most people. Lots more are in Unicode, so they can be added directly, but I don't know how widely they are supported by browsers, operating systems, and font character sets. I wouldn't be surprised if they disappear for some people if they set their font differently. Like these:
⅓ (1/3)
⅔ (2/3)
⅕ (1/5)
⅖ (2/5)
⅗ (3/5)
⅘ (4/5)
⅙ (1/6)
⅚ (5/6)
⅛ (1/8)
⅜ (3/8)
⅝ (5/8)
⅞ (7/8)
Not all are common in recipes, but many are helpful. I use some of them, but I don't know how to enter them except by cut and paste, so they are here mostly for my reference.

Let me know if you get funny characters where fractions should be.

No comments:

Post a Comment