Re: Smallmoney and money rounded to 2 decimals?
Fredy Paquet <[email protected]> Thu, 12 Apr 2018 10:23:15 +0200
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Organization | OPAG Informatik AG |
| Message-ID | <[email protected]> |
The original Sybase drivers have a similar problem. Sybase internally calculates with 4 digits, but all text export (BCP) routines render only 2 digits. On Thu, 2018-04-12 at 08:41 +0100, Frediano Ziglio wrote: > 2018-04-06 12:59 GMT+01:00 Sebastien FLAESCH <[email protected]>: > > Hi all, > > > > Using FreeTDS 1.00.9: > > > > When fetching a smallmoney or money data, SQLDescribeCol() returns > > the sqltype SQL_DECIMAL, precision 10 for smallmoney and or 19 for > > money and a scale of 4 for both types, which is fine, since > > smallmoney > > and money can store 4 decimal digits. > > > > Using an SQL_C_CHAR buffer to hold the values, we see that the > > decimal > > part is rounded to 2 digits... > > > > Is this expected? > > > > using other ODBC drivers for SQL Server we get 4 decimal digits. > > > > Is there some configuration settings to control this? > > > > Thanks! > > Seb > > Just checked. Yes, apparently Microsoft ODBC drivers format money > with > 4 decimal digit. > I think in the past tools used 2 digits but they moved to 4 along the > way. > There's actually no way to change that behavior but probably there > should be. > The 2 digits code is currently quite hard coded in src/tds/convert.c > and src/tds/numeric.c. > I suppose a good way would be to add a flag to TDSCONTEXT (which is > used during conversion to pass locale information). > > Frediano > _______________________________________________ > FreeTDS mailing list > [email protected] > https://lists.ibiblio.org/mailman/listinfo/freetds -- Fredy Paquet Mitglied der Geschäftsleitung OPAG Informatik AG Fabrikmattenweg 11 CH-4144 Arlesheim http://www.opag.ch Tel. ++41 61 716 92 22 Fax. ++41 61 716 92 29 _______________________________________________ FreeTDS mailing list [email protected] https://lists.ibiblio.org/mailman/listinfo/freetds
smime.p7s
(application/x-pkcs7-signature, 3.4 KB) - not displayed