Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

acme (189)

acme
  (email not shown publicly)
http://www.astray.com/

Leon Brocard (aka acme) is an orange-loving Perl eurohacker with many varied contributions to the Perl community, including the GraphViz module on the CPAN. YAPC::Europe was all his fault. He is still looking for a Perl Monger group he can start which begins with the letter 'D'.

Journal of acme (189)

Sunday June 19, 2005
03:05 PM

HTML::Fraction

[ #25275 ]
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...
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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.

    • 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 ;-)
  • common vulgar

    Isn't that redundant? ;)

    --
    The great thing about multitasking is that several things can go wrong at once.