• 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: number formatting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: number formatting


  • Subject: Re: number formatting
  • From: Bob Savage <email@hidden>
  • Date: Fri, 22 Feb 2002 21:25:28 -0600

> I think the statement that a text field should show the value of 0.4 as
> 0.4 is a fair specification for a default behavior of a text field.

But the point which was made is that, for the computer, the value 0.4 does
not exist. Think about it, you are looking at "0.4" which is in base ten,
but the computer doesn't use base ten. That was what the reference to the
IEEE was saying. The computer is looking at a base two floating point value
and "0.4" just ain't it.

What you are saying is roughly equivalent to saying that the default
representation of Pi should be "3".

If you want to represent a float for a user in base ten at some specific
precision, you can do that by using a formatting string or NSFormatter.

Bob
_______________________________________________
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.

References: 
 >Re: number formatting (From: Lance Bland <email@hidden>)

  • Prev by Date: Long tale of woe regarding NSPrintInfo, NSPageLayout, etc.
  • Next by Date: Re: bug in drawPageBorderWithSize
  • Previous by thread: Re: number formatting
  • Next by thread: Re: number formatting
  • Index(es):
    • Date
    • Thread