Re: Round a float
Re: Round a float
- Subject: Re: Round a float
- From: Steve Bird <email@hidden>
- Date: Mon, 28 Jul 2003 13:41:31 -0400
On Monday, July 28, 2003, at 09:41 AM, Lorenzo wrote:
Hi,
I have a
float floatSize = 105.55791;
and I would like to print it as @"105.5";
--- Everybody has said to use %0.1f, but notice that that function will
ROUND the number you gave UP to "105.6". If you really DO want to see
"105.5", you'll have to do the truncation yourself.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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.