第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用斷點調(diào)試時,其余參數(shù)正常,,但strlist的值為null?這是哪里錯了?

使用斷點調(diào)試時,其余參數(shù)正常,,但strlist的值為null?這是哪里錯了?

C# C
HUWWW 2022-06-01 11:07:24
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace WindowsFormsApplication1{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){}private void button1_Click(object sender, EventArgs e){double corpusAmount, interestRate,interestAmount, incomeAmount;int depositYear; //本金,利率,利息,總收入,存期try // 錄入數(shù)據(jù){corpusAmount = double.Parse(this.corpusTextbox.Text);interestRate = double.Parse(this.interestRatetextBox.Text);depositYear = Int32.Parse(this.depositYeartextBox3.Text);}catch //異常處理{MessageBox.Show(" Input dismatached !");return;}incomeAmount = corpusAmount * (Math.Pow((1 + interestRate), depositYear)); //計算總收入interestAmount = incomeAmount - corpusAmount; //計算利息//格式化列表string strList;strList = string.Format(" {0,15:c } {1,15:c } ", interestAmount, incomeAmount);listBox1.Items.Add(strList); //輸出```}}}
查看完整描述

3 回答

?
陪伴而非守候

TA貢獻1757條經(jīng)驗 獲得超8個贊

c后面 不要空格
double value1 = 16932.456;
double value2 = 15421.354;// {0,15:c } {1,15:c } 這個有空格 錯誤的
string result = String.Format("{0,15:c} {1,15:c}", value1, value2);

查看完整回答
反對 回復(fù) 2022-06-06
?
躍然一笑

TA貢獻1826條經(jīng)驗 獲得超6個贊

strList = string.Format(" {0,15:c } {1,15:c } "
這個是啥?{}里面不是占位符吧
format的用法是string.Format("{0},{1}",value1,value2);
{0}{1}都是占位符,分別對應(yīng)value1和value2的值

查看完整回答
反對 回復(fù) 2022-06-06
?
繁星淼淼

TA貢獻1775條經(jīng)驗 獲得超11個贊

返回的是2個double數(shù)值,一個得息,一個總收到,你用string.Format把他們轉(zhuǎn)換成字符串,比如一個數(shù)是10.59,另一個數(shù)是11.49,stringList="10.59$11.49$"(15:C應(yīng)該表示貨幣吧),你查下interestAmount,和incomeAmount有值么?

查看完整回答
反對 回復(fù) 2022-06-06
  • 3 回答
  • 0 關(guān)注
  • 172 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號