In Excel, format the currency as required with the Format->Cell->Number->Currency dialog. Then, in the same dialog, scroll to the end of the Custom Number formats and you should see the number format that you just used. Copy and paste this format into your Spreadsheet::WriteExcel program.
Here is a simple example for Sterling and the Hong Kong dollar (I didn't have Taiwanese dollar in my version of Excel):
#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new('currency.xls');
my $worksheet = $workbook->add_worksheet();
my $pound_sterling = $workbook->add_format(num_format => '£#,##0
+.00');
my $hong_kong_dollar = $workbook->add_format(num_format => '[$HKD]
+ #,##0.00');
# You can also use this slightly more explicit format for Sterling
+:
# [$£-809]#,##0.00
$worksheet->write('A1', 1.23, $pound_sterling);
$worksheet->write('A2', 1.23, $hong_kong_dollar);
--
John.
|