1.用postman访问接口,返回的小数点精度正常
2.返回到页面里的,小数点丢失
3.解决办法,在字段上加注解
@JsonFormat(shape = JsonFormat.Shape.STRING)
或者
@JsonSerialize(using= ToStringSerializer.class)
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;@JsonSerialize(using= ToStringSerializer.class)
private BigDecimal ycjmj;@JsonFormat(shape = JsonFormat.Shape.STRING)
private BigDecimal zbzmj;