Subject Re: [ib-support] Converting DOUBLE PRECISION to VARCHAR
Author sdbeames
> Take a look at F_FLOATOSTR in FreeAdHocUDF library:
>
> http://freeadhocudf.org/documentation_english/dok_eng_string.html

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
BEGIN
tempStr = testStr;
strsize = strsize - 1;
testStr = substr(tempStr, 1, strsize);
END

If I ever get the time and learn how to write a UDF I'll have a go myself if I have to.

Cheers,
Steve