Skip to Content.
Sympa Menu

freetds - Re: [freetds] tds_money_to_string conversion oddity

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] tds_money_to_string conversion oddity
  • Date: Mon, 08 Dec 2003 09:45:27 -0000

Il lun, 2003-12-08 alle 00:46, James K. Lowden ha scritto:
> On 07 Dec 2003, Frediano Ziglio <freddyz77 AT tin.it> wrote:
> > IMHO sprintf should not be used and code for old platforms should be
> > rewritten...
>
> I think sprintf is a very portable way to form string representations of
> numbers. I don't see any reason not to use it.
>

sprintf is portable %lld not... In this case I don't like the use of
sprintf to:
- not lose precision with conversion
- we build an array with digits (0-9) then format it, we should change
the code do output only 2 decimal digits instead of building a string
with 4 decimal digits and than use atof/sprintf to remove two digits...
The code compile only if a 64bit int is not present. Note however that
many conversions in convert.c require a 64bit int...

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page