Removing exponential format

Hi,

We have to write records of table to csv format. We were using following format

links: flip strintt`flt ! ((“vReporter”; “vData”; “CDR”); (1000; 2031; 4098); (0.00001; 0.000001; 0.0000001))

csv 0: links

It will give following result:

str,intt,flt

vReporter,1000,1e-005

vData,2031,1e-006

CDR,4098,1e-007

We do not want exponential format like above. we want the result in decimal format with n number of decimals.

We end up writing following function to apply formatting for float columns:

RemoveScientificNotation:{[tblName]

    mt:0!meta 1#tblName 

    ;colss:{[col] $[(col t)="f";".Q.f[16;] each ";""], string col c} each mt

    ;selectQry:“select “, (”,” sv colss), " from tblName"

    ;ff:parse selectQry

    ;?[tblName;raze ff 2;0b;ff 4]}

Is there any other way?

.Q.fmt

http://code.kx.com/wiki/DotQ/DotQDotfmt

should do what you want 

Thanks Simon reply. I think .Q.fmt internally uses .Q.f, that is what i am already using in function.
I just dont want it to do for every table present in database. There will be so many exports in a day and for each transaction i have to call the function i wrote that finds out float column and then fix the precision issue.