poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KHZ (SAW)" <karl-heinz.zenge...@sawag.com>
Subject AW: DataFormat of Cells
Date Fri, 28 Jan 2005 12:28:27 GMT
Hi Mili.

It should be something similar to (adapt it to your needs)

oCS.setDataFormat(oFmt.getFormat("#,##0 \u0080"));

oCS is the HSSF cell style a and oFmt is the HSSF data format. Instead
of \u... (which was taken for Euro) you take your $ sign ($ should be a
standard ASCII character; I hope so).

If I remember it right 0 says that the output is mandatory. So you
format up to the maximum number of characters which can occur and add
the things behind the "." with 0. It's some time ago. So I hope I
remember it right.

Regards,	Karl-Heinz.


-----Urspr√ľngliche Nachricht-----
Von: Mili Aggarwal, Noida [mailto:milia@noida.hcltech.com] 
Gesendet: Freitag, 28. Januar 2005 12:34
An: POI Users List
Betreff: DataFormat of Cells

 

Hi All,
	An Excel sheet provides for formatting cells in "Accounting"
format.
Does POI provide any such feature?

Actually, my requirements wants me to display data in the form of
$xyz.ab,

Where, no of digits before decimal can be of any length but after the
decimal ONLY 2 digits are allowed but the String should be prefixed by
$.

Can anyone tell me how to accomplish the same ASAP.

Thanks a LOT in advance..


Warm Regards,
Mili Aggarwal

------------------------------------------------------------------------
----
-----------------------------DISCLAIMER---------------------------------
----
------------------------------------------------------------------------
----
---------

This message and any attachment(s) contained here are information that
is
confidential, proprietary to HCL Technologies and its customers.
Contents
may be privileged or otherwise protected by law. The information is
solely
intended for the individual or the entity it is addressed to. If you are
not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of
it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.





---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/




---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message