private void calculator2() { double quantity = Convert.ToDouble(nudQuantity2.Value); double rate = Convert.ToDouble(nudRate2.Value); if (quantity == 0 || rate == 0) { return; } double realQuantity = Math.Ceiling(quantity * rate / 100.0); tbQuantity2.Text = Convert.ToInt32(realQuantity).ToString("N0"); long quantity2 = Convert.ToInt64(tbQuantity2.Text.Replace(",", "")); lbQuantity2.Text = MoneyUtil.Number2Hangle(quantity2) + "개"; }
private void calculator() { double fund = Convert.ToDouble(nudFund.Value); double rate = Convert.ToDouble(nudRate.Value); double price = Convert.ToDouble(nudPrice.Value); if (fund == 0 || rate == 0 || price == 0) { return; } double realFund = Math.Ceiling(fund * rate / 100.0); double realQuantity = Math.Ceiling(realFund / price); tbQuantity.Text = Convert.ToInt32(realQuantity).ToString("N0"); long fund2 = Convert.ToInt64(fund); lbMoney.Text = MoneyUtil.Number2Hangle(fund2) + "원"; long quantity = Convert.ToInt64(tbQuantity.Text.Replace(",", "")); lbQuantity.Text = MoneyUtil.Number2Hangle(quantity) + "개"; }