NAME
Lingua::ZHO::Num2Word - Converts numeric values into their Chinese string equivalents
VERSION
version 0.2603270
SYNOPSIS
# OO Style
use Lingua::ZHO::Num2Word 'pinyin';
my $shuzi = Lingua::ZHO::Num2Word->new( 123 );
print $shuzi->get_string;
my $lingyige_shuzi = Lingua::ZHO::Num2Word->new;
$lingyige_shuzi->parse( 7340 );
$chinese_string = $lingyige_shuzi->get_string;
# Function style
print number_to_zh( 345 ); # automatically exported
# Change output format
Lingua::ZHO::Num2Word->charset('big5');
Only numbers from interval [0, trillion) can be converted.
DESCRIPTION
Number 2 word conversion in ZHO.
This module tries to convert a number into Chinese cardinal number. It supports decimals number, and five representation systems (charsets): traditional, simplified, big5, gb and pinyin. The first two are returned as unicode strings; hence they are only available for Perl 5.6 and later versions.
The interface conforms to the one defined in Lingua::EN::Number, but you can also use this module in a functionnal manner by invoking the number_to_zh() function.
FUNCTIONS
- charset
- get_string
- map_zho
- new
- number_to_zh
- parse
SEE ALSO
ACKNOWLEDGMENTS
Sean Burke for suggesting me to write this module.
AUTHORS
initial coding:
Autrijus Tang E<lt>autrijus@autrijus.orgE<gt>
specification, maintenance:
Richard C. Jelinek E<lt>rj@petamem.comE<gt>
maintenance, coding (2025-present):
PetaMem AI Coding Agents
COPYRIGHT
Copyright 2002, 2003, 2004 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as the Artistic License 2.0 or the BSD 2-Clause License. See the LICENSE file in the distribution for details.