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.
Page 1 / 1
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
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
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
Ok, I think i figured it out where i lost the decimal. I have expression evaluatore that (@Value(WorkType_count)/@Value(Total_Count))*100
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
Thank you everyone!
Takashi,
You were right, I saw that a bit too late, so added the last bit to my second reply :-)
David