Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在c#方法中将decimal作为参数发送_C#_Arguments - Fatal编程技术网

如何在c#方法中将decimal作为参数发送

如何在c#方法中将decimal作为参数发送,c#,arguments,C#,Arguments,我有一个简单的类,它的构造函数是这样的: public Components(int sNo, string componentName, string fileType, **decimal size**, int totalDownloads, string filePath, **decimal price**, string description) 我试图通过调用以下语句来发送参数: new DatabaseObjects.Components(1, "CC Cleaner", "e

我有一个简单的类,它的构造函数是这样的:

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

这是说不能将双精度转换为十进制

我怎样才能解决这个问题

请帮助我使用
2.84m

密码

普通
2.84
解析为,不能隐式转换为
decimal