Skip to main content
Question

stop the numbers from rounding

  • August 20, 2015
  • 7 replies
  • 59 views

ruby
Contributor
Forum|alt.badge.img+6
  • Contributor
  • 16 replies
Hi, I am reading a Oracle SQL file and writting it to EXCEL.  My SQL file give me a value of 100.893657 and When I write that to EXCEL file it just writes 100 Or even writing to inspector it gives 100.  Is there a way I can tell FME to write the way it appears 100.893657.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

david_r
Celebrity
  • 8391 replies
  • August 21, 2015
Hi

 

 

You will probably have to format the cells to display the decimals, otherwise Excel might only display the cell value rounded to the closest integer.

 

 

Lots of examples online, e.g. http://www.excel-easy.com/examples/custom-number-format.html

 

 

You might also want to consider using an Excel template file in FME to prevent redoing this all the time.

 

 

David

david_r
Celebrity
  • 8391 replies
  • August 21, 2015
Also, you can define the output column as a number with a specified format, e.g.

 

 

 

 

Finally, verify that you do not perform any integer operations on your number before passing it to the writer. Famous examples include dividing it by an integer value in an ExpressionEvaluator (FME 2014 and earlier).

 

 

David

takashi
Celebrity
  • 7842 replies
  • August 21, 2015
Hi,

 

 

but the question mentions that "Or even writing to inspector it gives 100".

 

The decimal fraction has been lost during the translation process?

 

 

Takashi

ruby
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 16 replies
  • August 21, 2015
Ok, I think i figured it out where i lost the decimal.  I have expression evaluatore that (@Value(WorkType_count)/@Value(Total_Count))*100

david_r
Celebrity
  • 8391 replies
  • August 21, 2015
Hi

 

 

Seems like you found it. In case you still need it, you can force a floating point operation by casting at least one of your attributes as a float, e.g. like this

 

 

(@double(@Value(WorkType_count))/@Value(Total_Count))*100.0

 

 

David

ruby
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 16 replies
  • August 21, 2015
Thank you everyone!

david_r
Celebrity
  • 8391 replies
  • August 21, 2015
Takashi,

 

 

You were right, I saw that a bit too late, so added the last bit to my second reply :-)

 

 

David