Re: round(), handling numbers
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/