aspose file tools
The moose likes Java in General and the fly likes How to Trim Numbers if No Decimal Values Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to Trim Numbers if No Decimal Values" Watch "How to Trim Numbers if No Decimal Values" New topic
Author

How to Trim Numbers if No Decimal Values

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1254
I have number values that have two decimal places. I am using java to export these values to excel. I need to check the number, if it has no decimal value change it to integer, if it has display as is. I am also keeping a cumlative value for each column that needs to be handled the same way.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26151
    
  66

Originally posted by Steve Dyke:
I need to check the number, if it has no decimal value change it to integer, if it has display as is.

Why? Excel can handle decimal places. What are you trying to accomplish with this?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to Trim Numbers if No Decimal Values
 
Similar Threads
HSSF and getNumericCellValue()
only allow user to enter two digits after decimal
Working with Decimal values
Decimals not converting to correct fractions
conversion