Click here to Skip to main content
15,916,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: About the icons on the desktop? Pin
Christian Graus25-Jun-01 10:55
protectorChristian Graus25-Jun-01 10:55 
GeneralBackground and text colors of the date/time picker Pin
Serge Weinstock25-Jun-01 0:07
Serge Weinstock25-Jun-01 0:07 
GeneralDisable pages on a CPropertysheet Pin
24-Jun-01 23:48
suss24-Jun-01 23:48 
GeneralRe: Disable pages on a CPropertysheet Pin
Tomasz Sowinski25-Jun-01 1:53
Tomasz Sowinski25-Jun-01 1:53 
GeneralAPI for obtaining Subnet Mask Pin
Yamuna24-Jun-01 23:47
Yamuna24-Jun-01 23:47 
GeneralRound() function Pin
24-Jun-01 23:30
suss24-Jun-01 23:30 
GeneralRe: Round() function Pin
Christian Graus24-Jun-01 23:44
protectorChristian Graus24-Jun-01 23:44 
GeneralTry these... Pin
Anna-Jayne Metcalfe25-Jun-01 0:34
Anna-Jayne Metcalfe25-Jun-01 0:34 
<br />
// This function will round a number upwards if it's modulus is greater<br />
// than or equal to 0.5 or round it down if it is less than 0.5<br />
double Round(double dVal)<br />
{<br />
	double dRemainder = fabs(fmod(dVal, 1) * (int)10);<br />
	<br />
	if (dVal > 0)<br />
	{<br />
		if (dRemainder >= (int)5)<br />
			return ceil(dVal);<br />
<br />
		return floor(dVal);<br />
	}<br />
<br />
	if (dRemainder >= (int)5)	// Negative numbers require special treatment<br />
		return floor(dVal);<br />
<br />
	return ceil(dVal);<br />
}<br />
<br />
<br />
//	Round to a specified number of decimal places<br />
double Round(double dVal, UINT nDecPlaces)<br />
{<br />
	double dFactor = pow(10.0, (double)nDecPlaces);<br />
	return ( Round( dVal * dFactor) / dFactor);<br />
}<br />


Andy Metcalfe - Sonardyne International Ltd
(andy.metcalfe@lineone.net)
http://www.resorg.co.uk

"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
GeneralRe: Round() function Pin
#realJSOP25-Jun-01 3:35
professional#realJSOP25-Jun-01 3:35 
GeneralRe: Round() function Pin
25-Jun-01 5:34
suss25-Jun-01 5:34 
GeneralRound() function Pin
24-Jun-01 23:29
suss24-Jun-01 23:29 
GeneralWhere is the real error about CArray::GetAt(int n) function Pin
24-Jun-01 21:30
suss24-Jun-01 21:30 
GeneralRe: Where is the real error about CArray::GetAt(int n) function Pin
markkuk24-Jun-01 21:43
markkuk24-Jun-01 21:43 
GeneralRe: Where is the real error about CArray::GetAt(int n) function Pin
Tomasz Sowinski25-Jun-01 1:43
Tomasz Sowinski25-Jun-01 1:43 
Generalusing two table in 1 software Pin
24-Jun-01 21:12
suss24-Jun-01 21:12 
GeneralRe: using two table in 1 software Pin
Tim Deveaux25-Jun-01 4:51
Tim Deveaux25-Jun-01 4:51 
GeneralSuperb Pin
25-Jun-01 14:51
suss25-Jun-01 14:51 
GeneralRe: Superb Pin
25-Jun-01 20:28
suss25-Jun-01 20:28 
GeneralRe: Superb Pin
Tim Deveaux26-Jun-01 13:25
Tim Deveaux26-Jun-01 13:25 
GeneralPrint preview Pin
24-Jun-01 21:00
suss24-Jun-01 21:00 
GeneralRe: Print preview Pin
Christian Graus24-Jun-01 23:30
protectorChristian Graus24-Jun-01 23:30 
GeneralRe: Print preview Pin
25-Jun-01 20:24
suss25-Jun-01 20:24 
GeneralRe: Print preview Pin
Christian Graus25-Jun-01 23:13
protectorChristian Graus25-Jun-01 23:13 
GeneralQuestion about the file of VC Project Pin
24-Jun-01 20:26
suss24-Jun-01 20:26 
GeneralRe: Question about the file of VC Project Pin
Michael Dunn24-Jun-01 21:28
sitebuilderMichael Dunn24-Jun-01 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.