Solved

convert to decimal or double

Posted on 2013-01-12
4
243 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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