473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 7745
.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Oliver | last post by:
Hello, I may have posted in the wrong place, if so, feel free to move my post (just notify me where you put it via email or something) I’m having a problem with my program that I cant...
2
by: Ed Crowley | last post by:
I have the following code: Dim BuilderForm As frmBuilder BuilderForm = New frmBuilder(_LastChangedFile.Path) BuilderForm.Refresh() BuilderForm.ShowDialog() And get the following...
1
by: mike | last post by:
My program is crashing, but it doesn't crash on a single line of code. Below is what the output tab displays. I have no idea where to start inorder to debug this problem. Is there any suggesstions...
0
by: Nikhil Khade | last post by:
Hello, After around 3 months, I reopened a old VB.NET solutions which used to work (and build) without any errors. Just to test it again, I build it again and it completed, without any errors,...
5
by: Ankit Aneja | last post by:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the Application Block I configured the DAAB using the Enterprise Library Configuration now this is the error which is coming ...
3
by: Emily | last post by:
Hi, I have the following code and an unhandled exception. Code: UnitInventory inventory; foreach (object obj in list) //debugger points to list where exception occurs {
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
1
by: ramya naidu | last post by:
Hi I have classes property and sketch in htis property will be linked to skecth class and foure different classes which r linked to the skecth class and two generic list one is for skecth and...
7
by: j4richard | last post by:
Help please, I am getting this "Unhandled Exception has occurred in your application" " A Generic error occurred in GDI+" See the end of this message for details on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.