I have a simple class which has a constructor in this manner:
public Components(int sNo, string componentName, string fileType, **decimal size**, int totalDownloads, string filePath, **decimal price**, string description)
i'm trying to send the arguments by calling this statement:
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")
But as you can see when i try to send the arguments in this way it is not taking 2,84 as one value it is taking 2 as one argument and 84 as one argument.
and when i try to replace ,with . i mean 2,84 as 2.84
it is saying cannot convert double to decimal.
How can i solve this problem ?
Please help me
Use the decimal literal 2.84m
.
Plain 2.84
is parsed as a double, which cannot be implicitly converted to a decimal
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With