static void Main(string[] args) { var sales = new SalesCounter("sales.csv"); var amountPerStore = sales.GetPerCategorySales(); foreach (var obj in amountPerStore) { Console.WriteLine("{0} {1:#,#}원", obj.Key, obj.Value); } }
static void Main(string[] args) { SalesCounter sales = new SalesCounter(@"Sales.csv"); Dictionary <string, int> amountPerCategory = sales.GetPerCategorySales(); foreach (var obj in amountPerCategory) { Console.WriteLine("{0} {1:N0}円", obj.Key, obj.Value); } }
static void Main(string[] args) { var sales = new SalesCounter("Sales.csv"); var amountPerCategory = sales.GetPerCategorySales(); //商品カテゴリ別売り上げを求める foreach (var obj in amountPerCategory) { Console.WriteLine("{0} {1:#,#}円", obj.Key, obj.Value); } }
static void Main(string[] args) { var sales = new SalesCounter("sales.csv"); var amountPerProductCategory = sales.GetPerProductCategorySales(); foreach (var obj in amountPerProductCategory) { Console.WriteLine("{0} {1}", obj.Key, obj.Value); } Console.ReadLine(); }
static void Main(string[] args) { var sales = new SalesCounter("Sales.csv"); //var amountPerStore = sales.GetPerStoreSales();//店舗別売り上げを求める var amountPerCategory = sales.GetPerCategorySales();//商品カテゴリ別売り上げを求める foreach (var obj in amountPerCategory) { Console.WriteLine("{0} {1:0,000}円", obj.Key, obj.Value); //カンマや小数点はこんな感じで。円は{}の外に。{1:#,#}円でも同じ結果になる。 } }
static void Main(string[] args) { var sales = new SalesCounter("Sales.csv"); //List<Sale> sales = ReadSales("Sales.csv"); //var amountPerStrore = sales.GetPerStoreSales(); // 店舗別売り上げを求める var amountPerCategory = sales.GetPerCategorySales(); // 商品カテゴリ別売り上げを求める foreach (var obj in amountPerCategory) { Console.WriteLine("{0} {1:#,0}円", obj.Key, obj.Value); } }