Compiler Error CS0664
Visual Studio 2005
Error Message
Literal of type double cannot be implicitly converted to type 'type'; use an 'suffix' suffix to create a literal of this typeAn assignment could not be completed; use a suffix to correct the instruction. The documentation for each type identifies the corresponding suffix for the type.
The following sample generates CS0664:
// CS0664.cs
class M
{
static void Main()
{
decimal m = 1.0; // CS0664
// try the following line instead
// decimal m = 1.0M;
System.Console.WriteLine(m);
}
}