I am looking at the book “Head First C #,” and in one of the chapters I created a program and uses variables declared as ints and decimal numbers. Visual Studio shuddered several times with me about mixing and juxtaposing the two. For example:
dinnerParty.NumberOfPeople = (int) numericUpDown1.Value;
NumberOfPeople is declared as an int, and apparently the numeric updates are decimal.
In addition, the book places M after some numbers, adding them together. For example:
public void SetHealthyOption(bool healthy)
{
if (healthy)
{
CostOfBeveragesPerPerson = 5.00M;
}
else
{
CostOfBeveragesPerPerson = 20.00M;
}
}
CostOfBeveragesPerPerson is declared as decimal.
So, I have two specific questions:
1) How can you find out when you need to quit something? I'm sure there is a little for casting ... can anyone provide some good links to learn about casting?
2) What does M do after numbers?
EDIT
, M , , . : () 50,00? ? , "" , Google?