On Tue Aug 24 07:50:25 2010, wjaguar wrote:
Show quoted text> Still doesn't fix the general problem, only a single specific case. The
> construct was described as "[$some_text-locale_code]" for a reason -
> "some_text" may be something *other* than a "$".
> An example is right there in the second cell of sample file - 826331.94
> with a format string of "# ##0,00\ [$руб.-419];-# ##0,00\ [$руб.-419]",
> still getting mangled into "826,331.94 [$руб.419]" instead of
> "826,331.94 руб."
Hi,
Could you provide some test cases in the following format as used in
21_number_format_user.t:
[ 140, 27400, '$27,400.00', '[$$-409]#,##0.00' ],
E.e, Test case number, unformatted number, expected formatted result,
the format.
You can see the existing ones in:
http://github.com/jmcnamara/spreadsheet-parseexcel/blob/master/t/21_number_format_user.t
Show quoted text> What works in general case is:
> if ($format =~ s/(\[\$(.+?)(-\d+)?\])/$2/) ...
> Because the locale code is in fact optional - as in the case of
> "# ##0,00 [$RUR];-# ##0,00 [$RUR]" format string.
> I attached a new sample file with all 3 mentioned formats.
Add this to the test cases as well.
Show quoted text> Maybe Spreadsheet::ParseExcel also should use current
> locale's thousand separator and decimal separator when rendering numeric
> formats?
Not in the lifetime of this universe. :-)
Trying to account for every possible date, time and currency format in
every locale and language just isn't possible. As a workaround, a future
release of the module will return the number format along with the
unformatted value which will allow the end user to process the number as
they wish.
John.
--