我有一个简单的类,它有一个以下方式的构造函数:
public Components(int sNo, string componentName, string fileType, **decimal size**, int totalDownloads, string filePath, **decimal price**, string description)
我正在尝试通过调用以下语句来发送参数:
new DatabaseObjects.Components(1, "CC Cleaner", "exe", **2,84**, 0, @"C:\Users\admin\Desktop\Software_Components\CCCleaner.exe", **5,00**, "To clean up junk files and invalid Registry entries")
但是,正如您所看到的,当我尝试以这种方式发送参数时,它并没有将2,84作为一个值,而是将2作为一个参数,84作为另一个参数。
当我尝试用.代替, 我的意思是将2,84写成2.84
它会说无法将double转换为decimal。
我该如何解决这个问题?
请帮帮我。