View Full Version : semi wa who
dennishea
11-07-2006, 03:24 PM
Ok, finaly got a form that converts inches to mm and back. Now I need to learn how to wack off some of the numbers to the right of the decimal place. Any guidence would be greatly appreciated.
dennishea :)
bmanske
11-07-2006, 04:08 PM
dennishea,
Look up the SPRINTF command in the help. It can help you format a string for display.
Or did you want to actually modify the value of the variable to have a given precision?
Brad
dennishea
11-07-2006, 04:31 PM
bmanske
I have been trying sprintf and printf and I can't seem to get the syntaxe right. I also need to have my numedit$ accept decimals, example .005. Minus the decimal issue this is the code that's working. When I put sprintf in I loose the correct answer.
func BUTTON101_OnClick(hWnd$, Msg$, wParam$, lParam$)
HandleEventParms
conv$ = str(0.03937);
if (str(edit_get(NUMEDIT104$)) > str(edit_get(NUMEDIT105$)))
Edit_Set((NUMEDIT105$),STR((edit_get(NUMEDIT104$)) / conv$));
else
Edit_Set((NUMEDIT104$),STR((edit_get(NUMEDIT105$)) * conv$));
end;
return (true);
end;
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.