Re: Double Fun
Re: Double Fun
- Subject: Re: Double Fun
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 6 Feb 2006 20:55:52 -0800
I'd also recommend using NSDecimalNumber if you're dealing with prices.
-jcr
On Feb 6, 2006, at 3:03 PM, Andrew Thompson wrote:
If I had to guess, I would say that your method call [[self
extendedSellingPrice] doubleValue] was somehow modifying
totalSellPrice.
~Andrew
On Feb 6, 2006, at 1:19 PM, 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
_______________________________________________
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
_______________________________________________
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