了解房产的精确度和规模

Pro*_*eus 6 coldfusion coldfusion-9

property name="poiLat" length="60" ormtype="big_decimal" persistent=true precision="16" scale="14" default="0" hint="";
Run Code Online (Sandbox Code Playgroud)

我不正确地理解精度或比例.使用上面的属性为什么'1'会出错并且'2'被接受?应该怎么做才能接受'1'

1)-118.27 =错误

2)-18.27 =好的

maf*_*fue 8

比例是指小数点右边的位数.如果你有精度16和刻度14,你只能在小数点左边有2位数,所以

18.12345678901234 = ok 
118.27 = error
Run Code Online (Sandbox Code Playgroud)

尝试:

precision="16" scale="13" 
Run Code Online (Sandbox Code Playgroud)

这将允许118.1234567890123,但这是很多小数位.你真的需要多少?

precision="16" scale="4"
Run Code Online (Sandbox Code Playgroud)

将允许123456789012.1234