Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I am creating a very simple job - reading data from database and exporting the result set in csv
using tDBInput to read the data, tFileOutPutDelimited to export the data
in the select statement I am converting an amount as DECIMAL (10,6) so in the result set I have
etc. etc.
and in the schema I defined it as Double as Type, Decimal as DB type with lenght 10 and precision 6
when I edit the csv output using notepad++ all the zeros as the end of the numbers are gone. so
0.000487
--> in the csv I get 0.1443
is there a way to have all the 6 decimals even if 0s ?
thanks
sergio
I think the easiest way to achieve this is to output the decimals as String to the file (CSV files are essentially file of Strings anyway), then use code like this (maybe in a tMap before the output component) to format the numbers....
String.format("%.6f", row1.doubleColumn)
I think the easiest way to achieve this is to output the decimals as String to the file (CSV files are essentially file of Strings anyway), then use code like this (maybe in a tMap before the output component) to format the numbers....
String.format("%.6f", row1.doubleColumn)
it worked!!! thank you very much!