How to round up to nearst decimals? Eg 23.33 to final output to 23.5 and 23.55 to final output to 24
Use ceil()
function to "round up to closest 0.5".
ceil(col * 2) / 2
The above will return -1 for -1.3. If you instead want -1.5, do
sign(col) * CEIL(ABS(col) * 2) / 2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.