freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] tds_money_to_string conversion oddity
- 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: Sun, 07 Dec 2003 13:01:37 -0000
Il dom, 2003-12-07 alle 07:17, James K. Lowden ha scritto:
> On Sat, 06 Dec 2003 18:04:17 -0600, "Craig A. Berry" <craigberry AT mac.com>
> wrote:
> >
> > I think I placed too much faith in there being a reason for the exact
> > layout of the format string. The attached patch solves the problem by
> > putting the "0." where it belongs (after the percent sign).
> ...
> - sprintf(s, "0.%02f", atof(s));
> + sprintf(s, "%0.02f", atof(s));
>
> By bad, Craig, sorry about that. I applied your patch, except that we
> don't need/want the leading zero, yes?
>
> sprintf(s, "%.02f", atof(s));
>
> should do the trick, I think.
>
> Regards,
>
I rewrite some code yesterday so this code compile only on platform that
do not support a 64bit int (mainly for performance reasons)... Note
however that conversion from money to double can lose precision and
should be avoided...
freddy77
-
[freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/06/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/06/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
James K. Lowden, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Frediano Ziglio, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Frediano Ziglio, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/07/2003
- Re: [freetds] tds_money_to_string conversion oddity, Frediano Ziglio, 12/08/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
James K. Lowden, 12/07/2003
- Re: [freetds] tds_money_to_string conversion oddity, Frediano Ziglio, 12/08/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Frediano Ziglio, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Frediano Ziglio, 12/07/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
James K. Lowden, 12/07/2003
- <Possible follow-up(s)>
-
RE: [freetds] tds_money_to_string conversion oddity,
Lowden, James K, 12/08/2003
- RE: [freetds] tds_money_to_string conversion oddity, Chris Eleveld, 12/08/2003
-
RE: [freetds] tds_money_to_string conversion oddity,
Craig Berry, 12/08/2003
- RE: [freetds] tds_money_to_string conversion oddity, Frediano Ziglio, 12/08/2003
-
Re: [freetds] tds_money_to_string conversion oddity,
Craig A. Berry, 12/06/2003
Archive powered by MHonArc 2.6.24.