in reply to Re: Changing numbers into words
in thread Changing numbers into words
Here's how it would look like using a modern vesion of the module, including the addition of pounds and pence as per the OP's request.
use Lingua::EN::Numbers qw( num2en ); my $en = num2en(313721.23); my ($pounds, $pence) = split(/ point /, $en); if ($pounds eq 'One') { $pounds .= ' pound'; } else $pounds .= ' pounds'; } $pence ||= 'Zero'; $pence .= ' pence'; $en = "$pounds and $pence"; print("$en\n")
Untested.
|
|---|