Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String to number
Message
From
13/10/2004 14:38:24
 
 
To
13/10/2004 14:23:16
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00950700
Message ID:
00951158
Views:
14
>Hey, thanks for volunteering Bonnie. Let us know what you find out. :-)

Wait a minute!!! I was actually trying to be subtle about suggesting that *you* benchmark it. <g>

~~Bonnie



>Hey, thanks for volunteering Bonnie. Let us know what you find out. :-) ...Just kidding. :-) I have historically used Convert(), but since the base function is usually Parse(), I'll probably switch to that when applicable.
>
>Bill
>
>>
>>Possibly. It might be interesting to benchmark it, just for the helluva it.
>>
>>~~Bonnie
>>
>>
>>
>>>
>>>>Bill,
>>>>
>>>>According to the docs for Convert.ToDecimal():
>>>>
>>>>The return value is the result of invoking the Decimal.Parse method
>>>>
>>>>So, you might as well just use the Parse! <g> Actually, it doesn't say, and I don't know, if it compiles to the same IL code or not. If it does, then it really wouldn't matter which you use. If it doesn't, then that would mean that the Convert calls the Parse and that *would* be more inefficient.
>>>>
>>>>~~Bonnie
>>>>
>>>>
>>>>>Hi Bonnie,
>>>>>
>>>>>Do you know of reasons/constraints etc. for choosing Parse() or Convert() in a given scenario?
>>>>>
>>>>>Thanks,
>>>>>Bill
>>>>>
>>>>>>Jerry,
>>>>>>
>>>>>>Look at the Decimal.Parse() method.
>>>>>>
>>>>>>~~Bonnie
>>>>>>
>>>>>>
>>>>>>
>>>>>>>How can I convert a string of "25.50" to a number with the decimals?
>>>>>>>
>>>>>>>Thanks,
>>>>>>>
>>>>>>>Jerry
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform