Hello Tommi,

The Decimal::print() was broken.  I can see
I should have tested it some more.

I have fixed a few problems, now it it closer.
Entering your numbers in a little test program
in the database like:

SQL> select * from t1;

        C1         C2
---------- ----------
         1 1.23456789
         2      1.235
         3    3.14159

SQL>

It prints them out like:

goanna% ./tonum
c1=1 c1s=1
c2=1 c2s=1.23457 c2d=1.23457
c1=2 c1s=2
c2=1 c2s=1.2350 c2d=1.2350
c1=3 c1s=3
c2=3 c2s=3.14159 c2d=3.14159
goanna%

Where currently:

* I've tweaked it to use the default
std::ostream::precision(), which is 6.
However I wonder if I should use a default precision
higher than that to print the number in the first row
the same as sqlplus does.

* There appears to be a bug where it prints
C2 in the second row as 1.2350 instead of just
1.235.  I will look at that tomorrow.

* I think I can follow one of your earlier suggestions
and remove Decimal::fractionDigits.

I will send you some diffs soon.

Thanks, Mark

On Sun, 30 Sep 2007 18:59:20 +0200
Tommi Mäkitalo <[EMAIL PROTECTED]> wrote:

> no - still no luck. It does not work:
> 
> [EMAIL PROTECTED]:~/tntdb$ echo 'descr d;'|sqlplus -s hr/hr
>  Name                                      Null?    Type
>  ----------------------------------------- --------
> ----------------------------
> K                                         NOT NULL NUMBER(38,30)
> 
> [EMAIL PROTECTED]:~/tntdb$ echo 'select * from d;'|sqlplus -s hr/hr
> 
>          K
> ----------
> 1.23456789
>      1.235
>    3.14159
> 
> [EMAIL PROTECTED]:~/tntdb$ demo/sqlcmd 'oracle:XE;user=hr;passwd=hr' 'select
> * from d order by k'
> 16017727022054910243E-30
> 1.000000000000000000000000002350
> 3.000000000000000000000000141590
> 
> [EMAIL PROTECTED]:~/tntdb$
> 
> 
> This is on my linux-x86-box with oracle-xe 10.
> 
> Tommi

-- 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to