poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <n...@torchbox.com>
Subject Re: Formatting question
Date Wed, 16 Jan 2008 12:34:39 GMT
On Tue, 15 Jan 2008, Shane Adams wrote:
> I'm trying to convert a cell that is Numeric with a formatting string 
> that makes it look like a phone number. The format string is 
> "###\-###\-###".

That won't work with DecimalFormat, which is quite specialised in what it 
will and won't format

If you want to use DecimalFormat, try with a pattern of "###,###,###", and 
then change the occurances of "," to "-" in the resulting string you get 
back.

Otherwise, you'll need to play with alternate formatters from within 
java.text to find one that does what you need

Nick

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


Mime
View raw message