t = Replace(CStr(Evaluate(t)), ",", ".")
Private Sub CB_Click()
Dim cbc$, t$
cbc = CB.Caption
t = Calculatrice.txtResultat
If cbc = "CE" Then f = 0: t = 0: GoTo 1
If cbc = "C" Then t = IIf(Len(t) = 1, 0, Left(t, Len(t) - 1)): f = t: GoTo 1
If IsNumeric(cbc) Then
If f = "0" Or f Like "*=" Or Not f Like "*#" And Not f Like "*." Then
t = cbc
If f Like "*=" Then f = ""
Else
t = t & cbc
End If
Else
If Not f Like "*#" Then f = Left(f, Len(f) - 1)
If cbc = "." Then
If t Like "*." Then t = Left(t, Len(t) - 1)
If InStr(t, ".") Then Exit Sub
t = t & "."
Else
If cbc = "%" Then f = f & "%": cbc = ""
f = Replace(CStr(Evaluate("=" & f)), ",", ".")
t = IIf(f Like "E*", "E", f)
If t = "E" Then f = 0
End If
End If
f = f & cbc
1 Calculatrice.txtResultat = t
End Sub
f = Replace(CStr(Evaluate("=" & f)), ",", ".")
il reste un défaut, il faut cliqué plusieurs fois sur C pour remettre a zéro l'affichage
Private Sub CB_Click()
Dim cbc$, t$
cbc = CB.Caption
t = Calculatrice.txtResultat
If cbc = "CE" Then f = 0: t = 0: GoTo 1
If cbc = "C" Then
t = IIf(Len(t) = 1, 0, Left(t, Len(t) - 1))
If Not f Like "*#" And Not f Like "*." Then _
f = IIf(Len(f) = 1, 0, Left(f, Len(f) - 1))
f = IIf(Len(f) = 1, 0, Left(f, Len(f) - 1))
GoTo 1
End If
If IsNumeric(cbc) Then
If f = "0" Or f Like "*=" Or Not f Like "*#" And Not f Like "*." Then
t = cbc
If f Like "*=" Then f = ""
Else
t = t & cbc
End If
Else
If Not f Like "*#" Then f = Left(f, Len(f) - 1)
If cbc = "." Then
If t Like "*." Then t = Left(t, Len(t) - 1)
If InStr(t, ".") Then Exit Sub
t = t & "."
Else
If cbc = "%" Then f = f & "%": cbc = ""
f = Replace(CStr(Evaluate("=" & f)), ",", ".")
t = IIf(f Like "E*", "E", f)
If t = "E" Then f = 0
End If
End If
f = f & cbc
1 Calculatrice.txtResultat = t
End Sub
Lone-wolf 15.25+15.25 =30.5 non ???