473,624 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

An unhandled exception of type 'System.FormatE xception' 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.WriteLi ne("Exponentia l formatting - {0:E}", 888.8);

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

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

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

Console.WriteLi ne("Hexadecima l formatting - {0:x4}", 88);

Console.ReadLin e();

}

}

}

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

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

TQ
YC

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

"Willy Denoyette [MVP]" <wi************ *@pandora.be> wrote in message
news:%2******** ********@TK2MSF TNGP09.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.WriteLi ne("Exponentia l formatting - {0:E}", 888.8);
||
|| Console.WriteLi ne("Fixed-point formatting - {F3}", 888.8888);

Should be:
Console.WriteLi ne("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
1538
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 readily explain. The program connects to, then reads and creates a new flat old Dbase files (.DBF) stored on a network drive. The program itself is run from the very same network drive/folder.
2
4550
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 exception on the last line:
1
2098
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 on how to start debuging the problem 'DefaultDomain': Loaded 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll', No symbols loaded 'StoredProcedure': Loaded 'N:\Dev\Programs\MNTEST3.net\Template.NET\bin\StoredProcedure.exe', No symbols...
0
8515
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, but then immediately started showing me the message "An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll" at InitializeComponent() with all lines containing Image load or default icon, like the following: ...
5
9768
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 Security Exception Description: The application attempted to perform an operation not allowed
3
2156
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
12048
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 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
1
4049
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 other is for data of type Object when i run the program i iam grtting the error here public Sketch FirstData() {
7
10379
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 invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.