The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/bin/env perl

=pod

Basic formatting.

=cut

use warnings;
use strict;

use Number::FormatEng qw(format_eng format_pref);

my @numbers = qw(1234 0.00057 -1e14 0.00 1 9876e64 123456789012345678);

for (@numbers) {
    printf "%20s  -->  %-20s\n", $_, format_eng($_);
}

print "\n";

for (@numbers) {
    printf "%20s  -->  %-20s\n", $_, format_pref($_);
}