• 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
Re: floats and number formatters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: floats and number formatters


  • Subject: Re: floats and number formatters
  • From: Daniel Todd Currie <email@hidden>
  • Date: Wed, 14 Jul 2004 15:30:01 -0700

An easier way to do something this simple might be to use format strings:

[NSString stringWithFormat:@"%1.2f", floatValue]

-- DTC


On 2004 Jul 14, at 15:04, John Spicer wrote:

I have a field that receives a calculated value. I have a formatter on the field, set to +/-9999.99 (two digit precision).

The calculation returns something like 44.4599999, I **thought** the formatter would round it to two digits (i.e. 44.46) but that's not what I'm getting. I do get displayed 44.4599999.

What am I missing?
_______________________________________________
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.
_______________________________________________
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.


  • Follow-Ups:
    • Re: floats and number formatters
      • From: John Stiles <email@hidden>
References: 
 >floats and number formatters (From: John Spicer <email@hidden>)

  • Prev by Date: Re: Add a function to NSTextField like NSComBox's complete
  • Next by Date: Re: [options] Cocoa GUI Client to web based SQL database
  • Previous by thread: floats and number formatters
  • Next by thread: Re: floats and number formatters
  • Index(es):
    • Date
    • Thread