poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Pissarenko <mailing-li...@dapissarenko.com>
Subject RE: Problems with scientific notation in formulae
Date Thu, 10 Feb 2005 11:13:55 GMT
Hi!

Thanks for your answer!

Yesterday I found a solution, which seems to work.

In order to create a cell formula "1*3.6E-4", I use following statement

cell.setCellFormula("1*" + convertToString(3.6E-4));

where convertToString is defined as follows.

     public static String convertToString(double value)
     {
     	DecimalFormat format=null;
     	String formattedValue=null;

     	DecimalFormatSymbols symbols=null;

     	symbols=new DecimalFormatSymbols();
     	symbols.setDecimalSeparator('.');

     	format=new DecimalFormat("#.########################", symbols);

     	formattedValue=format.format(value);
     	return formattedValue;
     }

Best regards

Dmitri Pissarenko
--
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


---------------------------------------------------------------------
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