• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextField setFloatValue broken?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Jaguar NSImage Mystery: Why is -size lying?
  • Next by Date: problems filling the NSMatrix with NSImageCells in a NSMutableArray
  • Previous by thread: Abstract classes
  • Next by thread: Re: NSTextField setFloatValue broken?
  • Index(es):
    • Date
    • Thread