public void ShowInfo() { var header = "\"" + Name + "\""; MenuManager.DrawHeader(header, 73); if (Duration != 0) { Console.WriteLine($"Duration: {Duration} minutes"); } var calories = new string[1][]; calories[0] = new string[] { Proteins.ToString(), Fats.ToString(), Carbonohydrates.ToString() }; TableBuilder.DrawTable(new string[] { "Proteins", "Fats", "Carbonohydrates" }, calories); string[] columnsHeaders = new string[] { "Ingredient", "Unit", "Quantity" }; string[][] input = new string[Ingredients.Count][]; for (int i = 0; i < input.Length; i++) { var temp = Ingredients[i].ToDataArray(); temp[2] = Quantities[i].ToString(); input[i] = temp; } TableBuilder.DrawTable(columnsHeaders, input); //Console.WriteLine($"Calories: {"|".PadLeft(27)}{Calories.ToString().PadLeft(18)}{"|".PadLeft(18)}"); Console.WriteLine("-------------------------------------".PadLeft(73)); }
public override string ToString() { return ($"\nProteins {Proteins.ToString("0.##")} g = {(Proteins * 4).ToString("0.##")} Kcal" + $"\nFat {Fat.ToString("0.##")} g = {(Fat * 9).ToString("0.##")} Kcal" + $"\nCarbs {Carbs.ToString("0.##")} g = {(Carbs * 4).ToString("0.##")} Kcal" + $"\nTotalgram {TotalGrams.ToString("0.##")} g = {Kcal.ToString("0.##")} Kcal"); }
public void ShowIngredients() { var calories = new string[1][]; calories[0] = new string[] { Proteins.ToString(), Fats.ToString(), Carbonohydrates.ToString() }; TableBuilder.DrawTable(new string[] { "Proteins", "Fats", "Carbonohydrates" }, calories); string[] columnsHeaders = new string[] { "Ingredient", "Unit", "Quantity" }; string[][] input = new string[Ingredients.Count][]; for (int i = 0; i < input.Length; i++) { var temp = Ingredients[i].ToDataArray(); temp[2] = Quantities[i].ToString(); input[i] = temp; } TableBuilder.DrawTable(columnsHeaders, input); }
public virtual string ToString(string format, IFormatProvider formatProvider) { return(NameProduct + " " + Weight.ToString() + " " + Proteins.ToString() + " " + Fats.ToString() + " " + Carbohydrates.ToString()); }