vlapzer Posted March 15, 2012 Share Posted March 15, 2012 (edited) hey guys, i am having a problem with rounding. i need to round $input2 and $input5. here's my script : HotKeySet("{enter}", "button1") HotKeySet("{escape}", "button3") #region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=loon programma (86).exe #AutoIt3Wrapper_UseX64=n #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("Form1", 366, 295, 458, 139) $Label1 = GUICtrlCreateLabel("vul hier uw loon in :", 16, 16, 95, 17) $Label2 = GUICtrlCreateLabel("Dit verdient u per seconde :", 16, 48, 135, 17) $Label3 = GUICtrlCreateLabel("Dit verdient u per uur :", 16, 80, 109, 17) $Label4 = GUICtrlCreateLabel("Dit verdient u per dag :", 16, 112, 112, 17) $label = GUICtrlCreateLabel("Dit heeft u tot nu toe verdient :", 16, 160, 148, 17) $Input1 = GUICtrlCreateInput("", 192, 16, 150, 21) $Input2 = GUICtrlCreateInput("", 192, 48, 150, 21) $Input3 = GUICtrlCreateInput("", 192, 80, 150, 21) $Input4 = GUICtrlCreateInput("", 192, 112, 150, 21) $Input5 = GUICtrlCreateInput("", 192, 160, 150, 21) $Button1 = GUICtrlCreateButton("Start", 8, 216, 99, 57) $Button3 = GUICtrlCreateButton("Stop", 120, 216, 67, 57) $Label6 = GUICtrlCreateLabel("€", 176, 48, 10, 17) $Label7 = GUICtrlCreateLabel("€", 176, 80, 10, 17) $Label8 = GUICtrlCreateLabel("€", 176, 112, 10, 17) $Label9 = GUICtrlCreateLabel("€", 176, 160, 10, 17) $Label5 = GUICtrlCreateLabel("€", 176, 16, 10, 17) $Input6 = GUICtrlCreateInput("", 208, 232, 121, 21) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### $i = 0 ;GUISetBkColor ('') While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 button1() Case $Button3 button3() EndSwitch WEnd Func button3() Exit EndFunc ;==>button3 Func button1() GUICtrlSetData($Input2, Execute(GUICtrlRead($Input1) / 3600)) GUICtrlSetData($Input3, Execute(GUICtrlRead($Input1))) GUICtrlSetData($Input4, Execute(GUICtrlRead($Input1) * 8)) GUICtrlSetData($Input5, Execute(GUICtrlRead($Input2))) Sleep(1000) GUICtrlSetData($Input5, Execute(GUICtrlRead($Input2) + GUICtrlRead($Input2))) Do Sleep(1000) GUICtrlSetData($Input5, Execute(GUICtrlRead($Input5) + GUICtrlRead($Input2))) GUICtrlSetData($Input6, (@HOUR & ":" & @MIN & ":" & @SEC)) $i = $i + 1 Until $i = 86400 EndFunc ;==>button1 this is my firt post so i dont know how to post my script in a little box. please explain it to me. vlapzer Edited March 15, 2012 by vlapzer Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 15, 2012 Moderators Share Posted March 15, 2012 vlapzer,Welcome to the AutoIt forum. To put the code in nice boxes, you use Code tags - put [autoit] before and [/autoit] after your posted code. But it is more important to post in the correct section of the forum - I will move you there this time, but please pay more attention in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
James Posted March 15, 2012 Share Posted March 15, 2012 Rounding is a simple as calling Round. If you want the highest number, ceiling, or the lowest, floor. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now