Expand Minimize
5 out of 12 rated this helpful - Rate this topic

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);
   }
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.