Subject Re: formatting a number
Author Ali Gökçen
Hi Grant,
there may be an another ugly way if u don't want to use UDF.
i didn't try it but may works with some fix..

cast your number into tmp vachar(32) field.
add a special character to it tmp = tmp || '!'
do while substring(tmp from 30 for 1)<>'!'
tmp = '0' || tmp; -- put a ascii zero symbol right side
end

result = substring(tmp from 19 for 10); -- '0000012345'

Ali

P.S. TO engine devolopers: we want strlen built in function! ;)

--- In firebird-support@yahoogroups.com, Grant Brown <grant@s...>
wrote:
> Hi all,
>
> In FB1.5 how can I format a number into a string with a fixed
number of
> leading zeros inside of a stored procedure ?
>
> for example if the number is 10 then after formatting it would be
a
> string with a value of 0000010
>
> thanks in advance
>
> --
> Regards,
> Grant Brown
>
> Product Development Manager
> Phone : 02 4229 1185
> Mobile : 0412 926 995
> Email : grant@s...
> Web : www.sitedoc.com.au
>
> SiteDoc - Easy to Use - Powerful Results