這個問題在這里已經有了答案: C# 控制臺應用程式,不能將型別“double”隱式轉換為“string”? (1 個回答) 昨天關門。
我目前正在創建一個收銀臺應用程式,但在這一行出現錯誤:MessageBox.Show(total);. 有人能幫我嗎?錯誤:Argument 1: cannot convert from 'double' to 'string'
代碼:https ://www.toptal.com/developers/hastebin/remifuxisi
uj5u.com熱心網友回復:
您必須使用 ToString() 將雙精度轉換為字串。
MessageBox.Show(total.ToString());
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/481526.html
