私はVc++(C ++ / CLI)で急な学習曲線の始まりにいます
フォームのテキストボックスにテキスト(数値)をどのようにフォーマットしますか?
printf()
古き良き時代には簡単でした;-)
以下は動作しますが、小数点以下の桁数がたくさんあります。
小数点を1つだけ表示する必要があります。
つまり、22.4178301では なく22.4です。
//Calculate the Power and current
fPower2 = (pow((fVoltagePkPk * 0.5 * 0.707),2) / 2);
fCurrent2 = fPower2 / (fVoltagePkPk * 0.5 * 0.707);
//Display the Power amd current in the text boxes
txtPower2->Text = Convert::ToString(fPower2);
txtCurrent2->Text = Convert::ToString(fCurrent2);
ありがとう