You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "KHZ (SAW)" <ka...@sawag.com> on 2004/06/22 15:09:20 UTC

currency formatting: Euro

Hi world.
 
How do I obtain the Euro symbol?
 
The first trial was
      oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
 
That format string is the string written in the Excel macros when I
record them. I wondered why there is “$” when I see “€”.
 
So the next trial was "#,##0 €". But that brings the negation sign of
formal logic (similar to –i; but just one digit).
 
So how will I be successful to see € (Euro).
 
Regards,    Karl-Heinz.
 
 
 

AW: currency formatting: Euro

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi world.

Also others seem to have that problem (e.g.
http://www.mail-archive.com/poi-user@jakarta.apache.org/msg02220.html).
But that was also unanswered since more than a year.

Can  anybody give a hint?

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com] 
Gesendet: Dienstag, 22. Juni 2004 15:09
An: poi-user@jakarta.apache.org
Betreff: currency formatting: Euro

Hi world.
 
How do I obtain the Euro symbol?
 
The first trial was
      oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
 
That format string is the string written in the Excel macros when I
record them. I wondered why there is “$” when I see “€”.
 
So the next trial was "#,##0 €". But that brings the negation sign of
formal logic (similar to –i; but just one digit).
 
So how will I be successful to see € (Euro).
 
Regards,    Karl-Heinz.
 
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


AW: AW: currency formatting: Euro

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi Andrew.

This is a small example file. If needed I also could send you the simple
test project producing such a file using POI.

Also thanks to Björn and Michael. I'll immediately test the proposals.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: acoliver@apache.org [mailto:acoliver@apache.org] 
Gesendet: Mittwoch, 23. Juni 2004 01:20
An: poi-user@jakarta.apache.org
Betreff: Re: AW: currency formatting: Euro

Can someone send me a (very small) spreadsheet with euros/euro
formatting i=
n
it?

Thanks,

Andy
--=20
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or
its
general membership.  In fact they probably most definitively disagree
with
everything espoused in the above email.

> From: "KHZ (SAW)" <ka...@sawag.com>
> Organization: SAW
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Tue, 22 Jun 2004 16:51:55 +0200
> To: "'POI Users List'" <po...@jakarta.apache.org>,
> <ka...@sawag.com>
> Subject: AW: currency formatting: Euro
>=20
> Hi world.
>=20
> It's possible to select various Euro currency formatting symbols (or
> however it's named.
>=20
> I've tested it with several variants, e.g. "#,##0 [$=E2=82=AC-1]" or
also with
> -407 instead of -1 or even just $ without all that bracketing. It's
> always the same. I see the negation symbol of formal logic (a > turned
> 45=C2=B0 to the left).
>=20
> What's going wrong? Isn't the Euro symbol supported by POI? All
> notations lead to the same result. But these format strings are shown
> when recording Excel macros and don't lead to errors if they're
applied
> in POI.
>=20
> Regards,    Karl-Heinz.
>=20
>=20
> -----Urspr=C3=BCngliche Nachricht-----
> Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com]
> Gesendet: Dienstag, 22. Juni 2004 15:09
> An: poi-user@jakarta.apache.org
> Betreff: currency formatting: Euro
>=20
> Hi world.
>=20
> How do I obtain the Euro symbol?
>=20
> The first trial was
>     oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
>=20
> That format string is the string written in the Excel macros when I
> record them. I wondered why there is =E2=80=9C$=E2=80=9D when I see
=E2=80=9C=E2=82=AC=E2=80=9D.
>=20
> So the next trial was "#,##0 =E2=82=AC". But that brings the negation
sign of
> formal logic (similar to =E2=80=93i; but just one digit).
>=20
> So how will I be successful to see =E2=82=AC (Euro).
>=20
> Regards,    Karl-Heinz.
>=20
>=20
>=20
>=20
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org

RE: AW: currency formatting: Euro

Posted by Michael Zalewski <za...@optonline.net>.
First, the reason the Euro symbol isn't working is probably related to the strange way that Windows encodes the symbol.

US Windows uses Code Page 1252. In this character encoding, the euro is represented by (byte) 0x80.

Java uses Unicode. In Unicode, the euro symbol is (short) 0x20ac.

Other international versions of Windows use different code page encodings. I think the euro symbol is encoded differently on at least some of these sets.

I believe that POI makes the simplified assumption that you can convert from a one byte short character to a two byte Unicode by simply extending the high order byte with 0x00. Not so for the characters whose CpXxxx encodings are between 0x80 and 0x9f.

Second, if you have Excel 2000 or above, it is easy to produce the Euro symbol.

Type a numeric value into any cell, then choose Format | Cells from the menu bar. Select the Number tab page. Choose Currency from the listbox labeled Category. Then choose one of two built in formats (leading or trailing Euro) from the dropdown list labeled Symbol. For each of these two built in choices, you can choose 4 variants of how to display negative numbers, giving a total of eight built in formats).

I am not sure if the above works on Excel 97 (or even very early versions of Excel 2000). But I am pretty sure that Excel 97 still encodes the euro symbol as (byte) 0x80 instead of (short) 0x20ac

-----Original Message-----
From: acoliver@apache.org [mailto:acoliver@apache.org]
Sent: Tuesday, June 22, 2004 7:20 PM
To: poi-user@jakarta.apache.org
Subject: Re: AW: currency formatting: Euro

Can someone send me a (very small) spreadsheet with euros/euro formatting i=
n
it?

Thanks,

Andy
--=20
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or its
general membership.  In fact they probably most definitively disagree with
everything espoused in the above email.

> From: "KHZ (SAW)" <ka...@sawag.com>
> Organization: SAW
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Tue, 22 Jun 2004 16:51:55 +0200
> To: "'POI Users List'" <po...@jakarta.apache.org>,
> <ka...@sawag.com>
> Subject: AW: currency formatting: Euro
>=20
> Hi world.
>=20
> It's possible to select various Euro currency formatting symbols (or
> however it's named.
>=20
> I've tested it with several variants, e.g. "#,##0 [$=E2=82=AC-1]" or also with
> -407 instead of -1 or even just $ without all that bracketing. It's
> always the same. I see the negation symbol of formal logic (a > turned
> 45=C2=B0 to the left).
>=20
> What's going wrong? Isn't the Euro symbol supported by POI? All
> notations lead to the same result. But these format strings are shown
> when recording Excel macros and don't lead to errors if they're applied
> in POI.
>=20
> Regards,    Karl-Heinz.
>=20
>=20
> -----Urspr=C3=BCngliche Nachricht-----
> Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com]
> Gesendet: Dienstag, 22. Juni 2004 15:09
> An: poi-user@jakarta.apache.org
> Betreff: currency formatting: Euro
>=20
> Hi world.
>=20
> How do I obtain the Euro symbol?
>=20
> The first trial was
>     oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
>=20
> That format string is the string written in the Excel macros when I
> record them. I wondered why there is =E2=80=9C$=E2=80=9D when I see =E2=80=9C=E2=82=AC=E2=80=9D.
>=20
> So the next trial was "#,##0 =E2=82=AC". But that brings the negation sign of
> formal logic (similar to =E2=80=93i; but just one digit).
>=20
> So how will I be successful to see =E2=82=AC (Euro).
>=20
> Regards,    Karl-Heinz.
>=20
>=20
>=20
>=20
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: AW: currency formatting: Euro

Posted by ac...@apache.org.
Can someone send me a (very small) spreadsheet with euros/euro formatting i=
n
it?

Thanks,

Andy
--=20
Andrew C. Oliver
http://www.superlinksoftware.com/poi.jsp
Custom enhancements and Commercial Implementation for Jakarta POI

http://jakarta.apache.org/poi
For Java and Excel, Got POI?

The views expressed in this email are those of the author and are almost
definitely not shared by the Apache Software Foundation, its board or its
general membership.  In fact they probably most definitively disagree with
everything espoused in the above email.

> From: "KHZ (SAW)" <ka...@sawag.com>
> Organization: SAW
> Reply-To: "POI Users List" <po...@jakarta.apache.org>
> Date: Tue, 22 Jun 2004 16:51:55 +0200
> To: "'POI Users List'" <po...@jakarta.apache.org>,
> <ka...@sawag.com>
> Subject: AW: currency formatting: Euro
>=20
> Hi world.
>=20
> It's possible to select various Euro currency formatting symbols (or
> however it's named.
>=20
> I've tested it with several variants, e.g. "#,##0 [$=E2=82=AC-1]" or also with
> -407 instead of -1 or even just $ without all that bracketing. It's
> always the same. I see the negation symbol of formal logic (a > turned
> 45=C2=B0 to the left).
>=20
> What's going wrong? Isn't the Euro symbol supported by POI? All
> notations lead to the same result. But these format strings are shown
> when recording Excel macros and don't lead to errors if they're applied
> in POI.
>=20
> Regards,    Karl-Heinz.
>=20
>=20
> -----Urspr=C3=BCngliche Nachricht-----
> Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com]
> Gesendet: Dienstag, 22. Juni 2004 15:09
> An: poi-user@jakarta.apache.org
> Betreff: currency formatting: Euro
>=20
> Hi world.
>=20
> How do I obtain the Euro symbol?
>=20
> The first trial was
>     oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
>=20
> That format string is the string written in the Excel macros when I
> record them. I wondered why there is =E2=80=9C$=E2=80=9D when I see =E2=80=9C=E2=82=AC=E2=80=9D.
>=20
> So the next trial was "#,##0 =E2=82=AC". But that brings the negation sign of
> formal logic (similar to =E2=80=93i; but just one digit).
>=20
> So how will I be successful to see =E2=82=AC (Euro).
>=20
> Regards,    Karl-Heinz.
>=20
>=20
>=20
>=20
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


AW: currency formatting: Euro

Posted by "KHZ (SAW)" <ka...@sawag.com>.
Hi world.

It's possible to select various Euro currency formatting symbols (or
however it's named.

I've tested it with several variants, e.g. "#,##0 [$€-1]" or also with
-407 instead of -1 or even just $ without all that bracketing. It's
always the same. I see the negation symbol of formal logic (a > turned
45° to the left).

What's going wrong? Isn't the Euro symbol supported by POI? All
notations lead to the same result. But these format strings are shown
when recording Excel macros and don't lead to errors if they're applied
in POI.

Regards,	Karl-Heinz.


-----Ursprüngliche Nachricht-----
Von: KHZ (SAW) [mailto:karl-heinz.zengerle@sawag.com] 
Gesendet: Dienstag, 22. Juni 2004 15:09
An: poi-user@jakarta.apache.org
Betreff: currency formatting: Euro

Hi world.
 
How do I obtain the Euro symbol?
 
The first trial was
      oCS.setDataFormat(oFmt.getFormat("#,##0 $"));
 
That format string is the string written in the Excel macros when I
record them. I wondered why there is “$” when I see “€”.
 
So the next trial was "#,##0 €". But that brings the negation sign of
formal logic (similar to –i; but just one digit).
 
So how will I be successful to see € (Euro).
 
Regards,    Karl-Heinz.
 
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org