你运行以下语句就明白啦
Sub test()
strTemp = "123,45"
If InStr(1, strTemp, ",") Then
Mid(strTemp, InStr(1, strTemp, ",")) = "."
End If
MsgBox strTemp
End Sub
是将“逗号”替换为“点”
你运行以下语句就明白啦
Sub test()
strTemp = "123,45"
If InStr(1, strTemp, ",") Then
Mid(strTemp, InStr(1, strTemp, ",")) = "."
End If
MsgBox strTemp
End Sub
是将“逗号”替换为“点”
请教。
Private Function ConvertToString(number As Double) As String
Dim strTemp As String
strTemp = Format$(number, "0.000E+0")
If InStr(1, strTemp, ",") Then
Mid(strTemp, InStr(1, strTemp, ",")) = "."
End If
ConvertToString = strTemp '最后这句什么意思???是把strTemp最为参数给 ConvertToString(strTemp),但类型不匹配呀?
End Function