You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Mili Aggarwal, Noida" <mi...@noida.hcltech.com> on 2005/04/22 06:32:26 UTC

Setting precision of numbers?

How to set precision of numbers to be displayed in Excel..i.e. it should not
be rounded off????????


Warm Regards,
Mili Aggarwal
HCL TECHNOLOGIES LTD.
Noida, India.
Tel: +91 (0120) 2516321/328 Extn: 1052
Email: milia@noida.hcltech.com

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

This message and any attachment 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.






Disclaimer: 

This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, 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.



Re: Setting precision of numbers?

Posted by Abhi <ag...@gmail.com>.
 int tempvar = (int) (actualdoublevar*100);

c.setCellValue((double) tempvar/100);
this sets the precision of the cell to 2 decimal places.

The only problem with this code is if the precision needs to be changed to 3 
digits then the code needs to be touched. For this, the 100 used in the code 
could be replaced by another variable that is determined by the precision 
required.
 does that answer your question? or is it something else?

 On 4/22/05, Mili Aggarwal, Noida <mi...@noida.hcltech.com> wrote: 
> 
> How to set precision of numbers to be displayed in Excel..i.e. it should 
> not
> be rounded off????????
> 
> Warm Regards,
> Mili Aggarwal
> HCL TECHNOLOGIES LTD.
> Noida, India.
> Tel: +91 (0120) 2516321/328 Extn: 1052
> Email: milia@noida.hcltech.com
> 
> 
> ----------------------------------------------------------------------------
> 
> -----------------------------DISCLAIMER-------------------------------------
> 
> ----------------------------------------------------------------------------
> --------
> 
> This message and any attachment 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.
> 
> Disclaimer:
> 
> This message and any attachment(s) contained here are information that is
> confidential,proprietary to HCL Technologies and its customers, 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.
>