NSTextField setFloatValue broken?
NSTextField setFloatValue broken?
- Subject: NSTextField setFloatValue broken?
- From: Pierre-Olivier Latour <email@hidden>
- Date: Fri, 06 Sep 2002 11:32:09 +0200
Hi,
In 10.1, setFloatValue was apparently rounding the value automatically and
it was very pratical.
However, in 10.2, the text fields are set to strings like this one:
"0.05000000074505806"
It's very annoying. I tried truncating the values before calling
setFloatValue with:
inline float RoundValue(float x)
{
return ((float) ((int) (x * 1000.0))) / 1000.0;
}
But it still does not work. Any idea (apart from using a NSFormatter of
course)?
Another side effect is that if you enter a value in the text field, get it
with floatValue, then redisplay it, you do not see the value your entered
but very often a number with 10 or so decimal digits!
Has anybody reported this bug yet? Otherwise, I'll do.
_____________________________________________________________
Pierre-Olivier Latour email@hidden
MacOS X Developer
http://www.pol-online.net
_______________________________________________
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.