private void btnCalculateActionPerformed(java.awt.event.ActionEvent evt) {
var input1String = txtInput1.getText().trim();
var input1 = Integer.parseInt(input1String);
var input2String = txtInput2.getText().trim();
var input2 = Integer.parseInt(input2String);
var result = (input1/input2)/input2;
var resultString = String.valueOf(result);
txtOutput.setText(resultString);
如何将我的 var 更改为浮点数,以便我可以得到像 0,212 等的十进制数
ABOUTYOU
相关分类