As long as you have restricted your format patterns to something like: "($#,##0_);($#,##0)" ie. have no color information etc., java.text.DecimalFormat should be able to parse it for you.
However, if your pattern is slightly more complex, eg. has color information like in: "($#,##0_);[Red]($#,##0)" then you may need to extend java's DecimalFormat to strip out that information before invoking the super.parse(..) method. These may help: http://java.sun.com/j2se/1.4.2/docs/api/java/text/NumberFormat.html http://jakarta.apache.org/poi/apidocs/org/apache/poi/hssf/usermodel/HSSFData Format.html HTH, ~ amol > -----Original Message----- > From: news [mailto:[EMAIL PROTECTED] Behalf Of Joseph O\\\'Connell > Sent: Wednesday, September 28, 2005 1:43 PM > To: [email protected] > Subject: Re: Getting numeric cells as a formatted string > > > > I've ran into the same situation - does anyone have a simple solution? > > > David Roe <d.roe <at> cyprotex.com> writes: > > > > > Is there any way to get the value of a numeric cell as a string, > > formatted by the cells data format? Or do I have to write a > parser that > > can convert to each data format myself? > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > Mailing List: http://jakarta.apache.org/site/mail2.html#poi > The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/
