Click here to Skip to main content
15,906,947 members
Home / Discussions / C#
   

C#

 
GeneralFormat a STRING into a FLOAT Pin
Seraphin6-Apr-05 4:56
Seraphin6-Apr-05 4:56 
GeneralRe: Format a STRING into a FLOAT Pin
Tom Larsen6-Apr-05 5:14
Tom Larsen6-Apr-05 5:14 
GeneralRe: Format a STRING into a FLOAT Pin
Seraphin6-Apr-05 5:22
Seraphin6-Apr-05 5:22 
GeneralRe: Format a STRING into a FLOAT Pin
Tom Larsen6-Apr-05 5:28
Tom Larsen6-Apr-05 5:28 
GeneralRe: Format a STRING into a FLOAT Pin
Seraphin6-Apr-05 5:41
Seraphin6-Apr-05 5:41 
GeneralRe: Format a STRING into a FLOAT Pin
Tom Larsen6-Apr-05 6:03
Tom Larsen6-Apr-05 6:03 
GeneralRe: Format a STRING into a FLOAT Pin
Seraphin6-Apr-05 6:17
Seraphin6-Apr-05 6:17 
GeneralRe: Format a STRING into a FLOAT Pin
Ashok Dhamija6-Apr-05 18:52
Ashok Dhamija6-Apr-05 18:52 
float.Parse(str) method should also work. Perhaps you might have committed some small mistake here and there. For testing it, create a new Windows Form project and place a button1 on that. In the click event-handler, put the following code:
private void button1_Click(object sender, System.EventArgs e)
		{
			string str = "145.35";
			float x = float.Parse(str);
			MessageBox.Show(x.ToString());
		}

It works properly and the MessageBox shows the correct value of float variable as "145.35". If you use x in some expression such as x = x*2, again it will use the correct value. In the debug mode, when you check the value of x, again it shows the correct value. So please ensure that you use the proper coding, otherwise there is nothing wrong in the method.
GeneralMaking string HTML compliant Pin
tommazzo6-Apr-05 4:24
tommazzo6-Apr-05 4:24 
GeneralRe: Making string HTML compliant Pin
techieboi7-Apr-05 6:03
techieboi7-Apr-05 6:03 
GeneralRe: Making string HTML compliant Pin
tommazzo7-Apr-05 10:43
tommazzo7-Apr-05 10:43 
QuestionC# Cursor with a rectangle? Pin
elapid6-Apr-05 4:18
elapid6-Apr-05 4:18 
AnswerRe: C# Cursor with a rectangle? Pin
elapid6-Apr-05 6:04
elapid6-Apr-05 6:04 
GeneralRe: C# Cursor with a rectangle? Pin
Tom Larsen6-Apr-05 6:16
Tom Larsen6-Apr-05 6:16 
GeneralRe: C# Cursor with a rectangle? Pin
elapid6-Apr-05 7:13
elapid6-Apr-05 7:13 
GeneralRe: C# Cursor with a rectangle? Pin
Dave Kreskowiak6-Apr-05 8:18
mveDave Kreskowiak6-Apr-05 8:18 
GeneralRe: C# Cursor with a rectangle? Pin
elapid6-Apr-05 10:33
elapid6-Apr-05 10:33 
GeneralProperties Problem Pin
chettu6-Apr-05 3:41
chettu6-Apr-05 3:41 
GeneralType.GetType(name) Pin
cobyjone6-Apr-05 3:34
cobyjone6-Apr-05 3:34 
GeneralRe: Type.GetType(name) Pin
Tom Larsen6-Apr-05 4:15
Tom Larsen6-Apr-05 4:15 
GeneralRe: Type.GetType(name) Pin
cobyjone6-Apr-05 4:25
cobyjone6-Apr-05 4:25 
GeneralUpload files to Server through FTP Pin
Deepa306-Apr-05 3:15
Deepa306-Apr-05 3:15 
GeneralSave and Retrieve pdf/tiff/bmp/jpg from database Pin
Deepa306-Apr-05 3:07
Deepa306-Apr-05 3:07 
GeneralRe: Save and Retrieve pdf/tiff/bmp/jpg from database Pin
Richsolnuv4-Jun-05 2:56
Richsolnuv4-Jun-05 2:56 
QuestionMemoryStream och regular stream? Pin
Snowjim6-Apr-05 3:06
Snowjim6-Apr-05 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.