J
J Miro
When I use ToString method to format the value of a nullable numeric
variable, I get "No overload for method 'ToString' takes '1' arguments"
error message. Example:
Int32? myNum = 12345;
Console.WriteLine(myNum.ToString("n0")); //error
But if I declare myNum as non-nullable (Int32 myNum = 12345, then ToString
formats its value fine! Why does ToString method generate an error when used
against a nullable variable? I should mention that String.Format handles
formatting of nullable values fine.
Thanks,
Jay
variable, I get "No overload for method 'ToString' takes '1' arguments"
error message. Example:
Int32? myNum = 12345;
Console.WriteLine(myNum.ToString("n0")); //error
But if I declare myNum as non-nullable (Int32 myNum = 12345, then ToString
formats its value fine! Why does ToString method generate an error when used
against a nullable variable? I should mention that String.Format handles
formatting of nullable values fine.
Thanks,
Jay