Jump to content

Search the Community

Showing results for tags 'Round'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello everybody! I'm having trouble with rounding. The program I'm using rounds decimals down. Autoit's round function rounds them up. Example: round(174.126, 2) = 174.13 I need that round to be 174.12. Here's the actually script: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:Program FilesAutoinstallForm1.kxf $Form1 = GUICreate("AutoCalc", 227, 200, 15, 15, $WS_EX_TOPMOST) $Button1 = GUICtrlCreateButton("Calculate", 8, 144, 99, 25) $Button2 = GUICtrlCreateButton("Close", 120, 144, 91, 25) $Label4 = GUICtrlCreateLabel("", 72, 136, 4, 4) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Group1 = GUICtrlCreateGroup("Input", 8, 8, 209, 129) $Label1 = GUICtrlCreateLabel("Rate", 16, 32, 27, 17) $Label2 = GUICtrlCreateLabel("Number of Nights", 16, 64, 86, 17) $Input1 = GUICtrlCreateInput("0.00", 112, 24, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT)) $Label3 = GUICtrlCreateLabel("Total", 16, 96, 45, 28) GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif") $Input2 = GUICtrlCreateInput("1", 112, 56, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_RIGHT)) ;$Label5 = GUICtrlCreateLabel("0.00", 136, 96, 39, 28) GUICtrlSetFont(-1, 11, 400, 0, "MS Sans Serif") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 ;$val = round((((((GUICtrlRead($input1) * .1545) + GUICtrlRead($input1)) + 1.5 + .13) * GUICtrlRead($input2))), 2) $val = (((((GUICtrlRead($input1) * .1545) + GUICtrlRead($input1)) + 1.5 + .13) * GUICtrlRead($input2))) $Label5 = GUICtrlCreateLabel($val, 136, 96, 39, 28) case $Button2 Exit EndSwitch WEnd
×
×
  • Create New...