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: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] tds_money_to_string conversion oddity
  • Date: Sun, 7 Dec 2003 01:17:21 -0500

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,

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page