Very new to C#. I'm a workhorse but one step at a time. I'm trying to make simple program. "What is out the door cost of an item that has sales tax?" You should enter the program and then type the amount of the purchase. Then the purchase amount is multiplied by 1.07 to get the actual total. This is very simple and not much use to anyone who doesn't have a calculator, but how do you get the entered data (a string) converted to a number (a float) The ability to take strings and assign the value to a number is very important to me.
chmendell
0
Newbie Poster
Recommended Answers
Jump to PostTo convert string to float
string numberAsString = "50.5"; float floatingPointNumber = float.Parse(numberAsString);
To convert string to integer
string numberAsString = "50"; int number = int.Parse(numberAsString);
All 3 Replies
Ramy Mahrous
401
Postaholic
Featured Poster
chmendell
0
Newbie Poster
Ramy Mahrous
401
Postaholic
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.