|Subject||Re: [ib-support] Converting DOUBLE PRECISION to VARCHAR|
> Take a look at F_FLOATOSTR in FreeAdHocUDF library:Hi Milan,
yes, I've already looked at that, but it doesn't do the job. It requires you to pre-decide the precision of the result. I don't want 3.5 to come out as 3.500 just because another result might be 1.234.
I'm currently using this rather ungainly code fragment to achieve the right effect.....
-- remove trailing 0's from Qty
tempStr = Qty;
testStr = tempStr;
strsize = strlen(testStr);
while (strsize > 0 and testStr = Qty) do
tempStr = testStr;
strsize = strsize - 1;
testStr = substr(tempStr, 1, strsize);
If I ever get the time and learn how to write a UDF I'll have a go myself if I have to.