我想把一个double值转换成字符串并显示在HTML输入标记中。代码:
<input type="text" class="form-control" value="91"> <input
type="text" value="<%=details.getPhno()%>" class="form-control"
readonly>
嗯:
Double.toString(details.getPhno())
应该足够了,但你也可以这样做:
new StringBuilder().append(details.getPhno()).toString()
// or
String.format("%f", details.getPhno())
//or
String.valueOf(details.getPhno())