修复问题

pull/1/head
PJ568 9 months ago committed by GitHub
parent bde86e6a9c
commit 2e84773cbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -99,25 +99,19 @@ func _on_clear_pressed():
func ():
var : float
= .text.to_float()
= -
if not 使:
.text = "-" + str()
else:
.text = str()
.text = str()
使 = true
if str(.text.to_float()) != "0":
.text = str(- .text.to_float())
使 = true
func 退():
if 使:
if .text.length() >= 2:
.text = .text.left(-1)
else:
.text = "0"
使 = false
= false
return
.text = "0"
使 = false
= false
func ():
@ -182,7 +176,7 @@ func 按下点():
func ():
使 = false
var : float
if .text.right(1) == "=" or == "":
if .text.right(1) == "=" and != "":
= .text.to_float()
else:
= .text.to_float()
@ -201,6 +195,7 @@ func 等于():
.text = str(snappedf(, 0.0000001))
= false
= false
= false
func _on__pressed():
@ -211,9 +206,9 @@ func _on_设置_pressed():
get_tree().change_scene_to_file("res://设置.tscn")
func (str:String) -> String:
if str:
if str[0] == "0":
if str[1] == "0" or (str[1] != "." and str[1] != "="):
return (str.substr(1))
return str
func (str1:String) -> String:
if str1:
if str1[0] == "0":
if str1[1] == "0" or (str1[1] != "." and str1[1] != "=" and str1[1] != "+" and str1[1] != "-" and str1[1] != "*" and str1[1] != "/"):
return (str1.substr(1))
return str1

Loading…
Cancel
Save