Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert to decimal or double

Posted on 2013-01-12
4
Medium Priority
?
264 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:
Meir Rivkin earned 1500 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 42

Expert Comment

by:Meir Rivkin
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

Technology Partners: 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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Loops Section Overview

971 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