Search code examples
coldfusioncoldfusion-9

number format shorten longitude and latitude?


orm property name="poiLat" ormtype="big_decimal" notnull="true" persistent=true precision="16" scale="14"; property name="poiLong" ormtype="big_decimal" notnull="true" persistent=true precision="16" scale="14";

The input below would give an error due to it exceeding the length set on the properties. How in ColdFusion can I shorten the values if they exceed this.

34.037864685058594

-118.27606201171875

local.poiEntity.setpoiLat(local.NewlatO);
local.poiEntity.setpoiLong(local.NewlonO);

Solution

  • Ok i think I have this

    round(local.NewlatO*10^6)/10^6;

    this works out to 6 places