Click here to Skip to main content
15,909,373 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: extracting flags from an integer Pin
Hesham Amin13-Mar-03 6:54
Hesham Amin13-Mar-03 6:54 
GeneralRe: extracting flags from an integer Pin
Gary Kirkham13-Mar-03 6:55
Gary Kirkham13-Mar-03 6:55 
GeneralRe: extracting flags from an integer Pin
Hesham Amin13-Mar-03 7:11
Hesham Amin13-Mar-03 7:11 
GeneralRe: extracting flags from an integer Pin
Nitron13-Mar-03 8:11
Nitron13-Mar-03 8:11 
GeneralSystem Variables and PATH Pin
Brian Delahunty13-Mar-03 5:53
Brian Delahunty13-Mar-03 5:53 
GeneralDoubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 5:18
Brent Lamborn13-Mar-03 5:18 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham13-Mar-03 7:01
Gary Kirkham13-Mar-03 7:01 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 8:52
Brent Lamborn13-Mar-03 8:52 
Would it then look like this?

void CGraphView::OnBnClickedBtnplot()<br />
{<br />
<br />
	CStringArray strings;<br />
	strings.SetSize(26);<br />
	double* Labels;<br />
<br />
	GetDlgItem(IDC_PICT)->GetWindowRect(pictRect);<br />
	ScreenToClient(pictRect);<br />
<br />
	//Labels [1 - 26] (one for each hash mark)<br />
	//Don't use all of them though<br />
	Labels = GetLabelVals();<br />
<br />
	strings[1].Format("%.3d\n", Labels[1]);<br />
<br />
	SetDlgItemText(IDC_EDITINTERSECT, "INT"); <br />
	SetDlgItemText(IDC_EDITX1, strings[1]); <br />
	SetDlgItemText(IDC_EDITX2, "x2"); <br />
	SetDlgItemText(IDC_EDITX3, "x3"); <br />
	SetDlgItemText(IDC_EDITX4, "x4");<br />
	SetDlgItemText(IDC_EDITX5, "x5"); <br />
	SetDlgItemText(IDC_EDITY1, "y1");<br />
	SetDlgItemText(IDC_EDITY2, "y2"); <br />
	SetDlgItemText(IDC_EDITY3, "y3");<br />
<br />
	InvalidateRect(pictRect);<br />
}


Am I using the .Format correctly? The output on the screen is not correct. If Labels[1] is 10.26356897 then I get something like -85478 or something like that in the edit control when i run it. Could you give me an example of what it would take for my output to look like this: 10.3 I don't have a lot of space in the picture box so the output needs to be rounded to have only one number after the decimal place.


"It has become appallingly obvious that our technology has exceeded our humanity."
- Albert Einstein (1879-1955)

"I think there is a world market for maybe five computers."
- Thomas Watson (1874-1956), Chairman of IBM, 1943

"640K ought to be enough for anybody."
- Bill Gates (1955-), in 1981

"Half this game is ninety percent mental."
- Yogi Berra
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham13-Mar-03 9:03
Gary Kirkham13-Mar-03 9:03 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 9:13
Brent Lamborn13-Mar-03 9:13 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham13-Mar-03 9:08
Gary Kirkham13-Mar-03 9:08 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 11:06
Brent Lamborn13-Mar-03 11:06 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham13-Mar-03 11:10
Gary Kirkham13-Mar-03 11:10 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 11:19
Brent Lamborn13-Mar-03 11:19 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham13-Mar-03 11:40
Gary Kirkham13-Mar-03 11:40 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn13-Mar-03 17:19
Brent Lamborn13-Mar-03 17:19 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham14-Mar-03 2:09
Gary Kirkham14-Mar-03 2:09 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham14-Mar-03 2:33
Gary Kirkham14-Mar-03 2:33 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Gary Kirkham14-Mar-03 2:35
Gary Kirkham14-Mar-03 2:35 
GeneralRe: Doubles to Strings for Edit Box Output Pin
Brent Lamborn15-Mar-03 10:37
Brent Lamborn15-Mar-03 10:37 
GeneralRe: Doubles to Strings for Edit Box Output Pin
TomKat14-Mar-03 15:07
TomKat14-Mar-03 15:07 
GeneralProxy Authentication (again) Pin
thowra13-Mar-03 5:07
thowra13-Mar-03 5:07 
GeneralRe: Proxy Authentication (again) Pin
thowra21-Mar-03 22:38
thowra21-Mar-03 22:38 
Generallittle question by a Win32 starter Pin
indiocolifa13-Mar-03 5:05
sussindiocolifa13-Mar-03 5:05 
GeneralRe: little question by a Win32 starter Pin
Maximilien13-Mar-03 5:20
Maximilien13-Mar-03 5:20 

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.