Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我该如何编码,以便它显示百分之一的百分比?视觉基础
MsgBox("Percantage: " & (correctQuestions + wrongQuestions) / 2)
一个简单的方法是MsgBox("Percentage: " & Round(100 * (correctQuestions + wrongQuestions) / 2) & "%")
MsgBox("Percentage: " & Round(100 * (correctQuestions + wrongQuestions) / 2) & "%")
我使用 Round() 删除任何小数部分的地方;最多 2 位小数,例如,使用
MsgBox("Percentage: " & Round(100 * (correctQuestions + wrongQuestions) / 2, 2) & "%")
但请注意,您的公式所做的只是显示问题总数的一半;假设它们是正确的或错误的。