This documentation is archived and is not being maintained.

Compiler Error CS0664 

Error Message

Literal of type double cannot be implicitly converted to type 'type'; use an 'suffix' suffix to create a literal of this type

An 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);
   }
}
Show: