| View previous topic :: View next topic |
| Author |
Message |
server Guest
|
Posted: Tue Apr 03, 2007 7:35 pm Post subject: Rounding a number |
|
|
message unavailable |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Apr 03, 2007 7:35 pm Post subject: Re: Rounding a number |
|
|
I am trying to Round a number to an integer using C++ Builder. For
example when I type into the TEdit box the number 17.85. I would like
it to be 18.00.
Anybody can help me.
Thanks |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Apr 09, 2007 6:52 am Post subject: Re: Rounding a number |
|
|
Simple as this:
int roundedNumber = (int) (numberYouWantToRound + 0.5);
Good luck !!! |
|
| Back to top |
|
 |
|