Subject | Re: [firebird-support] Cast( float as varchar(20) ) formatting? |
---|---|
Author | LtColRDSChauhan |
Post date | 2010-07-09T03:23:57Z |
SET TERM ^ ;
ALTER PROCEDURE TRIM_TRAIL_0 (
DECVAL decimal(18,6) )
RETURNS (
VARVAL varchar(20) )
AS
BEGIN
VARVAL=cast(DECVAL as varchar(20));
if(DECVAL != ceil(DECVAL)) /* not to loose 0s in 100 */
then
begin
VARVAL= TRIM(TRAILING '0' from :VARVAL);
end
suspend;
END^
SET TERM ; ^
GRANT EXECUTE
ON PROCEDURE TRIM_TRAIL_0 TO SYSDBA;
ALTER PROCEDURE TRIM_TRAIL_0 (
DECVAL decimal(18,6) )
RETURNS (
VARVAL varchar(20) )
AS
BEGIN
VARVAL=cast(DECVAL as varchar(20));
if(DECVAL != ceil(DECVAL)) /* not to loose 0s in 100 */
then
begin
VARVAL= TRIM(TRAILING '0' from :VARVAL);
end
suspend;
END^
SET TERM ; ^
GRANT EXECUTE
ON PROCEDURE TRIM_TRAIL_0 TO SYSDBA;
On Fri, Jul 9, 2010 at 1:37 AM, bwc3068 <avert@...> wrote:
>
>
> Hi--
>
> This seems like something that should be easy OR I should've found easily
> on the group...but...
>
> If I:
>
>
> CharField = cast( FloatField as varchar(20) )
>
> I end up with:
>
> 1.2345 = "1.2345000000000000"
>
> How do I format it so the trailing "0"s are NOT in the return string?
>
> Thanks
> Kelly
>
>
>
--
Regards,
Lt Col (Retd) Rajiv Dular Singh Chauhan
09601704890
0265-2637655
_____________________________
[Non-text portions of this message have been removed]