Skip to Content.
Sympa Menu

freetds - Re: Negative SYBMONEY BUG

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Negative SYBMONEY BUG
  • Date: Thu, 14 Sep 2000 09:16:44 -0400 (EDT)


On Thu, 14 Sep 2000, Koscheev Andrey wrote:

> Howdy,
>
> Has anyone already mentioned that MONEY datatype is badly converted
> to char when money value is negative?
>
> On my Sybase ASE, TDS 4.2, dblib, Linux value -400.00 is displayed
> as -399.9744 and -30000.00 is -29999.9744. When I am connected to
> the same server from Microsoft's isql_w everything works fine.
>
> I think the problem is inside tds_money_to_string function. If
> someone could verify my guesses I would appreciate that.

Comparing the code for the JDBC driver to tds_money_to_string() in
freetds/src/tds/numeric.c, it looks as if the Java code avoids the
problem you describe, but introduces another. Both MONEY and SMALLMONEY
types are defined to preserve accuracy to a ten-thousandth of a monetary
unit, but the JDBC driver in Tds.getMoneyValue appears to be discarding
the two least significant decimal digits of this precision. Is this
intentional? It seems like an (inappropriate) U.S.-centric view of
monetary values.

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com




  • Negative SYBMONEY BUG, Koscheev Andrey, 09/14/2000
    • <Possible follow-up(s)>
    • Re: Negative SYBMONEY BUG, Bob Kline, 09/14/2000

Archive powered by MHonArc 2.6.24.

Top of Page