Re: Problem displaying correct double values in NSTextField (Cocoa)
Re: Problem displaying correct double values in NSTextField (Cocoa)
- Subject: Re: Problem displaying correct double values in NSTextField (Cocoa)
- From: Markus Hitter <email@hidden>
- Date: Sun, 3 Mar 2002 11:53:03 +0100
Am Sonntag den, 3. Mdrz 2002, um 06:56, schrieb John McGruer:
There seems to be a bug in NSTextField (Cocoa) that displays
double values
incorrectly. [...]
NSLog(@"answer = %lf", num3); //gives "answer = 8.540000"
This uses the same default formatting an printf(): "%.6lf"
[answerField setDoubleValue:num3]; //gives "8.539999999999" !!!
NSTextField does neither rounding nor any formatting. Attach an
NSFormatter (in Interface Builder) to get formatting. Will even
give you localized formatting.
Hope that helps,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.