PC Review


Reply
Thread Tools Rate Thread

Convert String to Float

 
 
Aaron
Guest
Posts: n/a
 
      23rd Nov 2004
Why can I not convert text from a text box to a float value. The text will
always be in the form of 0.00. No matter what System.Convert method I use I
get errors about the conversion that states cannot covert this to a that. I
could not find any help in the archives on this type of topic.

Thanks


 
Reply With Quote
 
 
 
 
Aaron
Guest
Posts: n/a
 
      23rd Nov 2004
Got it, didn't see it in the help at first but I was looking for
System.Convert.ToDouble();

"Aaron" <(E-Mail Removed)> wrote in message
news:Ylxod.2464$(E-Mail Removed)...
> Why can I not convert text from a text box to a float value. The text

will
> always be in the form of 0.00. No matter what System.Convert method I use

I
> get errors about the conversion that states cannot covert this to a that.

I
> could not find any help in the archives on this type of topic.
>
> Thanks
>
>



 
Reply With Quote
 
Aaron
Guest
Posts: n/a
 
      23rd Nov 2004
How can I cut a number off that I got from a textbox? I need to cut the
number off at the decimal without rounding, i.e. 7.6958 would be just 7. I
already have the number in a double format, just can't figure out how to cut
it off.

"Aaron" <(E-Mail Removed)> wrote in message
news:Ylxod.2464$(E-Mail Removed)...
> Why can I not convert text from a text box to a float value. The text

will
> always be in the form of 0.00. No matter what System.Convert method I use

I
> get errors about the conversion that states cannot covert this to a that.

I
> could not find any help in the archives on this type of topic.
>
> Thanks
>
>



 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      23rd Nov 2004
Math.Floor(val)
(there are also Ceiling and Round)

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Aaron" <(E-Mail Removed)> wrote in message
news:7Hxod.2468$(E-Mail Removed)...
> How can I cut a number off that I got from a textbox? I need to cut the
> number off at the decimal without rounding, i.e. 7.6958 would be just 7.
> I
> already have the number in a double format, just can't figure out how to
> cut
> it off.
>
> "Aaron" <(E-Mail Removed)> wrote in message
> news:Ylxod.2464$(E-Mail Removed)...
>> Why can I not convert text from a text box to a float value. The text

> will
>> always be in the form of 0.00. No matter what System.Convert method I
>> use

> I
>> get errors about the conversion that states cannot covert this to a that.

> I
>> could not find any help in the archives on this type of topic.
>>
>> Thanks
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String to Float Dave Microsoft C# .NET 5 20th Nov 2004 12:38 AM
Convert hex strings to string, float, int and double Uwe Kuhne Microsoft Dot NET Framework 2 6th Jan 2004 05:23 PM
convert a column to float Giulio Santorino Microsoft Access Queries 1 12th Sep 2003 03:29 PM
convert string to float Chi Tang Microsoft C# .NET 2 19th Aug 2003 11:28 PM
Re: how to convert string to integer/float Ivan Microsoft C# .NET 0 22nd Jul 2003 04:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 AM.