Beispiel #1
0
 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");
 }
Beispiel #2
0
        public string ToInsert()
        {
            var kcal    = Kcal.ToString().Replace(',', '.');
            var protein = Protein.ToString().Replace(',', '.');
            var fat     = Fat.ToString().Replace(',', '.');
            var carbs   = Carbs.ToString().Replace(',', '.');

            return($"('{ID}', '{Name}', '{kcal}', '{protein}', '{fat}', '{carbs}', '{Type}')");
        }