That above does work. Your problem lies somewhere else. This does the rounding only once, so if your float changes via calculations you need to round it again every time.
That above does work. Your problem lies somewhere else. This does the rounding only once, so if your float changes via calculations you need to round it again every time.