fix bad rounding on margin calculation and display