Jump to content
Sign in to follow this  
vlapzer

Please help me with rounding!

Recommended Posts

vlapzer

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 by vlapzer

Share this post


Link to post
Share on other sites
Melba23

vlapzer,

Welcome to the AutoIt forum. :oops:

To put the code in nice boxes, you use Code tags - put [autoit] before and [/autoit] after your posted code. :bye:

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. :doh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×