snap to grid rounding algo done.

Signed-off-by: Lee Jian Yi David <ljydavid@soctf-imac-028.comp.nus.edu.sg>