Solved

convert to decimal or double

Posted on 2013-01-12
4
233 Views
Last Modified: 2013-04-20
Dear experts
Dim amt As Double = Double.Parse(Me.Amount.Text.ToString()) is giving error

Input string was not in a correct format.

please support
0
Comment
Question by:bmkdubai
  • 2
4 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38771490
use tryparse instead:

Dim amt As Double

if(Double.TryParse(Me.Amount.Text.ToString(), out amt))
'parsing success
else
'parsing failed
end if

Open in new window

0
 
LVL 10

Expert Comment

by:Monica P
ID: 38818494
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 38818505
Debug your code check what is the value u try to parse.
It might be invalid number.
U can also check for null or empty before parsing using string.IsNullOrEmpty
0
 

Author Comment

by:bmkdubai
ID: 39097200
I've requested that this question be deleted for the following reason:

answers are not clear
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now