Number::Format /

Filename Size Date modified Message
9.0 KB
44.3 KB
203 B
524 B
509 B
3.8 KB
295 B
Number::Format - Convert numbers to strings with pretty formatting


Number::Format is a library for formatting numbers.  Functions are
provided for converting numbers to strings in a variety of ways, and
to convert strings that contain numbers back into numeric form.  The
output formats may include thousands separators - characters inserted
between each group of three characters counting right to left from the
decimal point.  The characters used for the decimal point and the
thousands separator come from the locale information or can be
specified by the user.

Also of note is the format_picture command which converts a number
into a string using a "picture" string that you provide.  This is
similar to the PRINT USING statement that some versions of BASIC have.

In addition, functions exist to generate strings for numbers
containing currency (e.g. "USD 9.99", "DEM 20.00", etc.) or for
rounding large values of bytes to the nearest giga/mega/kilo
(e.g. "1.5M", "640K", etc.).


The following are also available as part of the number-format
Sourceforge project:
  - Template Toolkit users: Use Template::Plugin::Number::Format
    (contributed by Darren Chamberlain) from your templates.
  - JavaScript users: we also have a JavaScript translation of the
    Number::Format done by Cees Hek.  Find that in our CVS repository


Download it from your favorite CPAN mirror, or from the Sourceforge

If you are interested in being a developer for this project, or for
more information, please contact William R. Ward,
(remove "SPAM" before sending email, leaving only my initials).


Perl version 5.8 or higher is required, though it may work on older
versions if you edit the 'require 5.008' line.  This package is set up
to configure and build like a typical Perl extension.  To build:

        perl Makefile.PL
	make test
        make install

NOTE: This installs the files in your core Perl module area, typically
/usr/local/lib/perl on Unix/Linux and C:\PERL\LIB on Windows, so you
may need super-user (root/administrator) access to install.  If you
wish to install in a private area, such as your home directory,
specify that as "perl Makefile.PL PREFIX=/path/to/private/area" and it
will be installed there instead.


Please submit your issues via the CPAN RT bug tracker or the
Sourceforge bug system:

Please check for existing bug reports on your issue in both places
before filing a new bug.


We have an electronic mailing list for announcements of new releases
of this module.  If you wish to join this list, visit this URL:

We also have a mailing list for developers which you may join if you
are interested in contributing to the project:

We do not yet have any list for users of the module; if you would like
one, let us know and we will look into it.

There are also forums available on the SourceForge site:


This package is copyright 1997-2008 by William R. Ward et al., and may
be distributed under the same terms as cover Perl itself (your choice
of Artistic or GPL).  See for more


See the file "CHANGES" for a description of the changes with each
version of Number::Format.  You can also browse the CVS history on
SourceForge for full details.