Trying to format response of dividing input of 100 sales/ 6 days to get sales needed per day. Want to format to 15 decimal places so answer would be 16.666666666666668 instead of 16. what is the best method?
using System;
using System.Collections.Generic;
namespace App
{
class Program
{
public static void Main()
{
Console.Write("Enter the number of sales: ");
int sales = int.Parse(Console.ReadLine());
Console.Write("Enter the number of days: ");
int days= int.Parse(Console.ReadLine());
double result = Math.Round((double)sales / (double)days, 15);
Console.WriteLine("The result: "+ result.ToString());
Console.ReadLine();
}
}
}
Comments
Leave a comment