#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 245, 219, 416, 581)
$Input1 = GUICtrlCreateInput("1", 64, 24, 153, 21)
$Input2 = GUICtrlCreateInput("1.14", 64, 56, 153, 21)
$Input3 = GUICtrlCreateInput("1.2", 64, 88, 153, 21)
$Input4 = GUICtrlCreateInput("", 64, 184, 153, 21)
$Button1 = GUICtrlCreateButton("计算", 55, 136, 123, 25)
$Label1 = GUICtrlCreateLabel("第一个", 24, 26, 40, 17)
$Label2 = GUICtrlCreateLabel("第二个", 24, 58, 40, 17)
$Label3 = GUICtrlCreateLabel("第三个", 24, 90, 40, 17)
$Label4 = GUICtrlCreateLabel("总 数", 24, 186, 37, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$count = GUICtrlRead($Input1) + GUICtrlRead($Input2) + GUICtrlRead($Input3)
GUICtrlSetData($Input4, $count)
MsgBox(0, 0, test($count))
EndSwitch
WEnd
Func test($n)
$a = StringRegExp($n, '(\d+)\.(\d)', 3)
If @error Then Return $n
If $a[1] > 5 Then
$a[0] += 1
Return $a[0]
ElseIf $a[1] <= 5 Then
$a[1] = 5
EndIf
Return $a[0] & '.' & $a[1]
EndFunc ;==>test