Fractions? Remember those? 1/3 and so on. Well, my recipes contain them. Turns out, there are HTML entities for common fractions (e.g. ½ is ½) and that common vulgar fractions have Unicode characters (e.g. ⅕ is ⅕). ½ looks much prettier than 1/2. Enter HTML::Fraction, which encodes fractions as HTML entities for you! No longer need you wonder how I made the pretty ingredient listing for Banana orange muffins...
Is there a reason for the OO interface there?
I’m also wary about it being oblivious to any sort of context. 2/3
could well be part of a tag in SGML, though not in XML. It would seem prudent to throw in at least a few \b
.
Neat idea though, I like it.
Re:
acme on 2005-06-20T15:00:20
No real reason, except that I don't like polluting namespaces. Oh, it's meant for text that you know is vaguely clean of course. If you have other data, patches welcome;-)
Isn't that redundant?