468,733 Members | 2,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,733 developers. It's quick & easy.

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

.YC
Hi, I was trying on the following code n I got an exception. Can anyone tell
me whats wrong?
using System;

namespace Module_2

{

/// <summary>

/// Summary description for Class1.

/// </summary>

class Write

{

/// <summary>

/// The main entry point for the application.

/// </summary>

[STAThread]

static void Main(string[] args)

Console.WriteLine("Exponential formatting - {0:E}", 888.8);

Console.WriteLine("Fixed-point formatting - {F3}", 888.8888);

Console.WriteLine("General formatting - {0:G}", 88.888); //I got
stuck here..

Console.WriteLine("Number formatting - {0:N}", 8888888.8);

Console.WriteLine("Hexadecimal formatting - {0:x4}", 88);

Console.ReadLine();

}

}

}

The message:
An unhandled exception of type 'System.FormatException' occurred in
mscorlib.dll

Additional information: Input string was not in a correct format.

TQ
YC

Nov 15 '05 #1
1 7300
.YC
Ooo ic
TQ
:P

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
.YC wrote:
|| Hi, I was trying on the following code n I got an exception. Can
|| anyone tell me whats wrong?

|| static void Main(string[] args)
||
|| Console.WriteLine("Exponential formatting - {0:E}", 888.8);
||
|| Console.WriteLine("Fixed-point formatting - {F3}", 888.8888);

Should be:
Console.WriteLine("Fixed-point formatting - {0:F3}", 888.8888);

Willy.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ed Crowley | last post: by
1 post views Thread by mike | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.