如何在速率中保留两位小数?
double rate;
double pi = Math.PI;
rate = fuel / distance ;
Console.WriteLine("Your fuel consumption rate is " + rate * 100 + "lt" + "/100km");
答案 0 :(得分:-1)
您可以按照以下方式显示它们,其中Math.Round()将帮助您在handleChange(e) {
this.setState({[e.target.name]: e.target.value})
}
<TextField
name="email"
onChange={this.handleChange}
/>
<TextField
name="password"
onChange={this.handleChange}
/>
中存储舍入小数
rate