Up Prev Next
From: "Tanja Davidson" <tanja_davidson at ncsu dot edu>
Subject: RE: Retaining Data Format
Date: Apr 16 2002 2:04PM
I will be out of the office Mon April 15th thru wednesday the 17th for an
XML Class and will not be checking email.
>>> "SYBPERL-L@list.cren.net" 04/16/02 09:54 >>>
Sabherwal, Balvinder (MBS) wrote:
>> I am trying to select few rows from the database using ct_sql
>> exec. same sql from an ISQL prompt I see the zeros after the decimal
>> where as if I try to print the results from the perl script, it
>> the zeros after the decimal. (i.e. 34.00 and 35.30 in isql are printed
>> and 35.3 respectively in perl)
>> Is this the normal behavior?? is there anyway I can get the values in
>> same format as in the ISQL Session??
>Try printf or sprintf.
>printf "%10.2f", $x;
>$formatted_x = sprintf "%10.2f", $x;
The only problem is I don't know if the value is a numeric or string as
ct_sql,undef,CS_TRUE will lose the sequence in which the columns are
from the server. Any other wayouts??