我的API看起来像这样:
@GetMapping("/floattest")
@ResponseBody
public ApiResult getFloatTest() {
ApiResult result = new ApiResult();
ApiObject test = new ApiObject(81684436f, 74258578f, 7425858f);
result.setData(test);
return result;
}
public class BalanceDetail {
private float a;
private float b;
private float c;
}
API调用返回:
{
"data": {
"a": 81684432,
"b": 74258576,
"c": 7425858
}
}
我浏览了浮点文档,但还有其他问题。
8.1684432E7
?或81684432?
8.1684432E7
会发生什么?