Hi all, I'm making a mini calculator for fun. My only problem is home
to convert the string in the text box to a double so it can be added,
subtracted, etc. I'm sure most people know how, but I'm a beginner.
Many thanks. James 4 2517
Hi James,
Use double.Parse
-Joe
"James" <ja**********@g mail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. . Hi all, I'm making a mini calculator for fun. My only problem is home to convert the string in the text box to a double so it can be added, subtracted, etc. I'm sure most people know how, but I'm a beginner. Many thanks. James This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Viktor Rosenfeld |
last post by:
Hi,
I need to create a parser for a Python project, and I'd like to use process
kinda like lex/yacc. I've looked at various parsing packages online, but
didn't find anything useful for me:
- PyLR seems promising but is for Python 1.5
- Yappy seems promising, but I couldn't get it to work. It doesn't even
compile the main example in it's documentation
- mxTexttools is way complicated. I'd like something that I can give a BNF
|
by: ARK |
last post by:
I am writing a search program in ASP(VBScript). The user can enter keywords
and press submit.
The user can separate the keywords by spaces and/or commas and key words may
contain plain words, single quoted strings (phrases), double quoted strings
(phrases).
For example:
Keywords:
Jack, Jill, Jim, "Timothy Brown", Mary OR
|
by: Daniel Lidström |
last post by:
Hi,
I'm currently using this method to extract doubles from a string:
System::String* sp = S" ";
System::String* tokens = s->Trim()->Split(sp->ToCharArray());
m_Northing = System::Double::Parse(tokens, nfi);
m_Easting = System::Double::Parse(tokens, nfi);
m_Elevation = System::Double::Parse(tokens, nfi);
|
by: BGP |
last post by:
I am working on a WIN32 API app using devc++4992 that will accept Dow
Jones/NASDAQ/etc. stock prices as input, parse them, and do things with
it. The user can just cut and paste back prices into a window and hit
a button to process it.
The information thus enters the program as a char array. Prices can be
between $1 and $100, including cents. So we can have prices such as
3.01, 1.56, 11.57, etc. The char array is an alphanumeric...
|
by: Ron |
last post by:
Hi,
I need to parse text (ie. created in Notepad) files for numbers (doubles).
In Borland C++ Builder the following works:
if(!InVect.is_open())
{
InVect.open(TxtFileName.c_str()) ;
}
| |
by: Bob |
last post by:
I'm having trouble the string.Format() throwing exceptions and I can't figure
out what I am doing wrong.
Given the following setup code:
string str = { "one", "two", "three", "four" };
double val = { 1.0, 2.0, 3.0, 4.0 };
string fmt = "{0} {1} {2} {3}";
The following variations of string.Format() will work just fine with strings:
string s1 = String.Format(fmt, str, str, str, str); // works
|
by: SL33PY |
last post by:
Hi,
I'm having a problem parsing strings (comming from a flat text input file)
to doubles.
the code:
currentImportDetail.Result = CType(line.Substring(7, 8).Trim(" "),
System.Double)
What is in my Watch:
|
by: broli |
last post by:
I need to parse a file which has about 2000 lines and I'm getting
told that reading the file in ascii would be a slower way to do it and
so i need to resort to binary by reading it in large chunks. Can any
one please explain what is all
this about ?
|
by: pereges |
last post by:
Hi I've a string input and I have to parse it in such a way that that
there can be only white space till a digit is reached and once a digit
is reached, there can be only digits or white space till the string
ends. Am I doing this correctly ? :
Code:
#include <stdio.h>
#include <string.h>
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |