Re: Limiting a float
Re: Limiting a float
- Subject: Re: Limiting a float
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 28 Aug 2003 15:30:15 +0200
At 16:05 Uhr -0700 27.08.2003, Emig 647 wrote:
I send the result to an NSTextField as a float...
The problem is the float is sent as 17.340209972309 and I want to limit it
to 2 places to the right of the decimal...
Use [NSString stringWithFormat: @"%f.2", myFloat] and pass that to
the text field's setStringValue:. (The format string is from memory.
Look up printf-style format strings in your ANSI reference if it
doesn't work the way you want)
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.