:)
What should I write to make the answer be shown as 2 or 3 decimals at the end? Thinking it's something with Math.Round but don't know what..
namespace Uppgift_1___Avrundaren
{
class Program
{
static void Main(string[] args)
{
string tal1;
double tal2;
int decimaler2;
string decimaler1;
Console.WriteLine("Avrundaren");
Console.WriteLine();
Console.WriteLine("Hej! Skriv in ett valfritt tal i decimalform:");
tal1 = Console.ReadLine();
tal2 = double.Parse(tal1);
Console.WriteLine("Skriv in hur många decimaler som önskas:");
decimaler1 = Console.ReadLine();
decimaler2 = int.Parse(decimaler1);
Console.Write("Dags att avrunda! Svaret blir: ");
Console.WriteLine(Math.Round(tal2, decimaler2));
Console.ReadKey();
}
}
}