I'm trying to convert an entry from a form text box to a double and am always getting "Input string was not in the correct format".
This is my code:
dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);
If I hardcode:
dblAmount = double.Parse("1 0000");
it works
I'm using C# .net
User Profile
Collapse
-
Converting .Text to double in C# .net
-
convert .Text to double
I'm trying to convert an entry from a form text box to a double and am always getting "Input string was not in the correct format".
This is my code:
dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);
If I hardcode:
dblAmount = double.Parse("1 0000");
it works
Do you know what I'm overlooking with my initial statement:
dblAmount... -
Format out put to 2 decimal places
Hi I'm new to C# and was wondering how to format the output to 2 decimal places.
This is my code:
dblA = dblB * dbl3;
I would need dblA to be for example: 3.75 and not 3.75333
Thanks for your help, -
Operator ^ and type error *** C# language ***
Hi,
I'm getting the follwoing error when I try the following operation in *** C# ***:
Error: Operator '^' cannot be applied to operands of type 'float' and 'int'
Operation: fltNumber ^ intNbr
I've tried to assign the numbers different data types but it always gives me the same error.
What data types does the '^' accept ??
Thx -
String convert to date
Hi,
I'm working on an assignment that requires I loop through a list box with time strings (ex: 1:38 PM, 1:40 PM etc.)
I need a time to compare the current time and the time in the list box and if the current time is greater I have a message box appearing.
I can't get the message box to appear after the timer increments (my timer is anabled at 60000 interval).
--This is the code structure I have... -
classes
Hi,
Can somebody provide me with an example on how one can transfer data from one class to another ?
I have one class 'processing' information that I then want to update into the "master_dat a" class. I then want to use the int main () to access the master_data class variables to output info.
Example:
The "processing " class would output "int x". How do I get "int... -
Hi rgb,
thanks for your reply. I'm new at this. Would you be able to elaborate ?
Thx, -
array
Hi,
Instead of:
char let[26] = {'A','B','C','D ','E',...., 'Z''};
What would be another (shorter) way of writing this ?
Thx, -
-
bool flag
C++ question: I've initialized some data elements in the int main function. the fourth element is a bool flag (set to false = 0). When I call a class function and that function tries to change the flag to true it doesn't work.
---
int main()
Calculate OB1 (4,25,25,0)
...
Class member function...
...
if (flag=0)
{
....
{
else...
No activity results to display
Show More
Leave a comment: