• 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: round(), handling numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: round(), handling numbers


  • Subject: Re: round(), handling numbers
  • From: Markus Hitter <email@hidden>
  • Date: Tue, 8 Jan 2002 11:18:50 +0100

Am Dienstag den, 8. Januar 2002, um 08:41, schrieb Martin Kautz:

Hello list,

I'm trying to write an conversion app to deal with our new currrency called
euro and unfortunately I'm stuck on round()...
Could someone post a little snippet to show how rounding can be done with
Cocoa/ObjC.

Do it the same way you do it in plain C:

[view setDoubleValue:ceil(output * 100. + .5) / 100.];

or add an NSFormatter to your value field in interface builder. Should work even when setting the value via an -set...Value method.

Note: To get correct localization other than english you have either to set the developing language to your localization of choice (no idea how to do it) or to add at least one localized file (i.e. Credits.rtf).


Viel Spass,
Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/


References: 
 >round(), handling numbers (From: Martin Kautz <email@hidden>)

  • Prev by Date: Re: round(), handling numbers
  • Next by Date: iPhoto and custom shaped window
  • Previous by thread: Re: round(), handling numbers
  • Next by thread: iPhoto and custom shaped window
  • Index(es):
    • Date
    • Thread