Re: Easy way to truncate floats?
Re: Easy way to truncate floats?
- Subject: Re: Easy way to truncate floats?
- From: "Kenneth C. Dyke" <email@hidden>
- Date: Tue, 14 Jan 2003 21:44:27 -0800
Try using %g instead of %f.
-Ken
On Tuesday, January 14, 2003, at 09:29 PM, Sheehan Olver wrote:
I'm writing a program that displays an equation, where some numbers
are stored as doubles. This means that, with a format of @"%f", I get
equations like "x^2.000000" instead of the desired result of "x^2". Is
there any way to trim off the trailing zeros?
_______________________________________________
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.
Kenneth Dyke, email@hidden (personal), email@hidden (work)
Sr. Mad Scientist, MacOS X OpenGL Group, Apple Computer, Inc.
Java: The blazing speed of SmallTalk with the simple elegance of C++.
_______________________________________________
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.