Re: Double Fun
Re: Double Fun
- Subject: Re: Double Fun
- From: Clark Cox <email@hidden>
- Date: Mon, 6 Feb 2006 16:43:26 -0500
No, "%d" is for integers, "%f" is the correct specifier for printing
floats or doubles.
On 2/6/06, Brett Powley <email@hidden> wrote:
> Hi Steve,
>
> Maybe you should be using %d instead of %f as your format specifier?
>
> Cheers,
> Brett
>
>
> On 07/02/2006, at 8:19 AM, Steve Cronin wrote:
>
> > Folks;
> >
> > Could some merciful person take away my misery here:
> >
> > double totalSellPrice, xtnSell, pct;
> > totalSellPrice = [[self totalSellingPrice] doubleValue];
> > NSLog(@"sellPrice = %f", totalSellPrice);
> > if ( totalSellPrice != 0 ) {
> > xtnSell = [[self extendedSellingPrice] doubleValue];
> > NSLog(@"ExtndSell = %f",xtnSell);
> > pct = (xtnSell/ totalSellPrice) * 100.00;
> > NSLog(@"Percent = %f",pct);
> > ...
> >
> > Results in these log entries:
> >
> > 2006-02-06 15:05:11.110 ABC[18600] sellPrice = 3888.407600
> > 2006-02-06 15:05:11.110 ABC[18600] ExtndSell = 84.018060
> > 2006-02-06 15:05:11.110 ABC[18600] Percent = 300.0000
> >
> > Thanks!
> > Steve
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Cocoa-dev mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40process.com.au
> >
> > This email sent to email@hidden
> >
>
>
>
> --------------------------------------------------------------
> Brett Powley -- PhD Candidate
> Centre for Language Technology, Macquarie University, Australia
> w: http://www.ics.mq.edu.au/~bpowley
> faciendi plures libros nullus est finis
> frequensque meditatio carnis adflictio est
> --------------------------------------------------------------
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden