Click here to Skip to main content
15,885,278 members
Home / Discussions / C#
   

C#

 
QuestionGet List Of Physical & Logical Drives Pin
Kevin Marois4-Jan-24 22:15
professionalKevin Marois4-Jan-24 22:15 
AnswerRe: Get List Of Physical & Logical Drives Pin
Richard Deeming4-Jan-24 22:50
mveRichard Deeming4-Jan-24 22:50 
GeneralRe: Get List Of Physical & Logical Drives Pin
Kevin Marois5-Jan-24 7:32
professionalKevin Marois5-Jan-24 7:32 
QuestionI need to convert a string to a float.... Pin
glennPattonWork33-Jan-24 2:15
professionalglennPattonWork33-Jan-24 2:15 
AnswerRe: I need to convert a string to a float.... Pin
Ron Nicholson3-Jan-24 2:23
professionalRon Nicholson3-Jan-24 2:23 
GeneralRe: I need to convert a string to a float.... Pin
glennPattonWork33-Jan-24 2:29
professionalglennPattonWork33-Jan-24 2:29 
GeneralRe: I need to convert a string to a float.... Pin
OriginalGriff3-Jan-24 5:05
mveOriginalGriff3-Jan-24 5:05 
AnswerRe: I need to convert a string to a float.... Pin
Richard Deeming3-Jan-24 2:30
mveRichard Deeming3-Jan-24 2:30 
Are you sure it compiles? String doesn't have a ConvertTo method, and you can't pass the Decimal type as an argument like that.

Assuming the text is a valid number, then Convert.ToSingle(rtdData.Text) should give you a float back. Or Convert.ToDecimal(rtdData.Text) would give you a decimal, which you would then have to cast to store in a float variable.

But these methods will throw an exception if the text is not a valid number. It would be better to use float.TryParse / decimal.TryParse so that you can notify the user if the value can't be parsed.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: I need to convert a string to a float.... Pin
glennPattonWork33-Jan-24 2:51
professionalglennPattonWork33-Jan-24 2:51 
GeneralToList() or not to List. Pin
Gerry Schmitz16-Dec-23 10:10
mveGerry Schmitz16-Dec-23 10:10 
GeneralRe: ToList() or not to List. Pin
Dave Kreskowiak16-Dec-23 13:44
mveDave Kreskowiak16-Dec-23 13:44 
GeneralRe: ToList() or not to List. Pin
Gerry Schmitz17-Dec-23 5:27
mveGerry Schmitz17-Dec-23 5:27 
GeneralRe: ToList() or not to List. Pin
Dave Kreskowiak17-Dec-23 5:56
mveDave Kreskowiak17-Dec-23 5:56 
GeneralRe: ToList() or not to List. Pin
jschell18-Dec-23 5:54
jschell18-Dec-23 5:54 
GeneralRe: ToList() or not to List. Pin
harold aptroot17-Dec-23 6:15
harold aptroot17-Dec-23 6:15 
GeneralRe: ToList() or not to List. Pin
Pete O'Hanlon18-Dec-23 3:49
mvePete O'Hanlon18-Dec-23 3:49 
Questioncircular slider on winform Pin
sdecorme11-Dec-23 3:23
sdecorme11-Dec-23 3:23 
AnswerRe: circular slider on winform Pin
Ralf Meier11-Dec-23 3:42
mveRalf Meier11-Dec-23 3:42 
Questionwrite the C# windows form based program that allow user conversion of number system Pin
Kemal Tajudin10-Dec-23 8:13
Kemal Tajudin10-Dec-23 8:13 
AnswerRe: write the C# windows form based program that allow user conversion of number system Pin
Dave Kreskowiak10-Dec-23 15:31
mveDave Kreskowiak10-Dec-23 15:31 
AnswerRe: write the C# windows form based program that allow user conversion of number system Pin
jschell11-Dec-23 4:36
jschell11-Dec-23 4:36 
QuestionC# multi agent framework based on MS Orleans Pin
Jerome Fortias 20229-Dec-23 5:10
Jerome Fortias 20229-Dec-23 5:10 
AnswerRe: C# multi agent framework based on MS Orleans Pin
Gerry Schmitz9-Dec-23 6:37
mveGerry Schmitz9-Dec-23 6:37 
GeneralRe: C# multi agent framework based on MS Orleans Pin
Jerome Fortias 20229-Dec-23 7:59
Jerome Fortias 20229-Dec-23 7:59 
QuestionMessenger design with C# Pin
parya mardani8-Dec-23 12:05
parya mardani8-Dec-23 12:05 

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.