property name="poiLat" length="60" ormtype="big_decimal" persistent=true precision="16" scale="14" default="0" hint="";
我不能正确理解精度或比例。使用上面的属性为什么“1”会出错而“2”会被接受?我应该把它改成什么来接受“1”
1 ) -118.27 = 错误
2) -18.27 = 好的
最佳答案
比例是指小数点后右边的位数。如果精度为 16,小数位数为 14,则小数点的 左 只能有 2 位,因此
18.12345678901234 = ok
118.27 = error
尝试:
precision="16" scale="13"
这将允许 118.1234567890123,但这是很多小数位。你真正需要多少?
precision="16" scale="4"
将允许 123456789012.1234
关于coldfusion - 了解属性的精度和规模,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11024511/