Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper way of moving from Double to Integer
Message
 
 
To
08/02/2012 15:25:20
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01534895
Message ID:
01534902
Views:
48
This message has been marked as a message which has helped to the initial question of the thread.
>>I suggest to use TryParse. See
>>
>>http://www.dreamincode.net/forums/blog/1693/entry-3714-got-the-net-casting-blues-tryparse-is-here-to-save-the-day/
>
>Ok, this is good to know.
>
>But, in my case, all the validation is already done that the value of the variable declared Double is one that fits for a value in the variable Integer. So, as is, the result would then be the same as using the TryParse as I did basically same thing in the code prior to that line.

I think it's always better to be explicit. In your case you will reply on implicit cast.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform