Solved

convert to decimal or double

Posted on 2013-01-12
4
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need syntax help building hyperlink 2 53
Please explain purpose of GZIP 4 83
Web page design problem 3 42
I need help writing Unit Tests for my ASP.Net MVC application 5 40
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Suggested Courses

710 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