in reply to Need help in Excel::Writer::XLSX
If you want the Indian numbering 12,34,567 it can get complicated. This only covers positive numbers up to 9 digits.
poj#!perl use strict; use warnings; use Excel::Writer::XLSX; my $book = Excel::Writer::XLSX->new( 'comma.xlsx' ); my $sheet = $book->add_worksheet(); # Add and define a format my $num = join ';','[>=10000000]##\,##\,##\,###', '[>=100000]##\,##\,###', '#,##0'; #$num = '##,##0'; # this does not work my $fmt_comma = $book->add_format(num_format=>$num); # format whole column my $width = 20; $sheet->set_column( 0, 1, $width, $fmt_comma ); my $n = 1; for (1..10){ $n=$n*10; $sheet->write_number( $_, 0, $n); $sheet->write_number( $_, 1, -$n); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help in Excel::Writer::XLSX
by Lotus1 (Vicar) on Feb 02, 2016 at 17:23 UTC | |
by poj (Abbot) on Feb 02, 2016 at 17:36 UTC | |
by Lotus1 (Vicar) on Feb 02, 2016 at 20:39 UTC |