I'm using ArcGIS Pro 2.8.2. I have Raster Calculator code that performs well for rounding and converting my data into julian dates, but it gets the wrong final result when the decimal is above 0.5 and should be rounded up. I'd like to add a Con function to the end, but am not sure exactly how to format it. Any help would be greatly appreciated!
My current code is:
Int((((Int(x)-1)*16)+1)+((x-Int(x))*16))
where x represents the raster's data.
Solved! Go to Solution.
A few more functions to consider:
Round Up (used to be Ceil())
Round Down (used to be Floor())
Either of these expressions will round a value >=0.5 up and others down
Int(x + 0.5)
RoundDown(x + 0.5)
y = Int((((Int(x)-1)*16)+1)+((x-Int(x))*16))
Con( (x - Int(x) < 0.5), y, y+1)
A few more functions to consider:
Round Up (used to be Ceil())
Round Down (used to be Floor())
Either of these expressions will round a value >=0.5 up and others down
Int(x + 0.5)
RoundDown(x + 0.5)