in reply to Spreadsheet::WriteExcel foreign currency
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.
|
|---|