Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Rounding (noob question)

Author
Message
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 15th Feb 2008 18:03
How do I go about rounding values, specifically floats? I need to be able to specify the number of decimal places to round to.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 15th Feb 2008 18:07 Edited at: 15th Feb 2008 18:10
Use sprintf from stdio.h, assuming you want to output to a string:



Login to post a reply

Server time is: 2024-11-20 01:34:49
Your offset time is: 2024-11-20 01:34:49