Possible Duplicate:
Are the decimal places in a CSS width respected?
Normally in CSS when we set a size we use while values in points or pixels. However, sometimes it is not possible to know the exact widths, so I jQuery to calculate it with .width() function and then perform some math, like divide by the number of elements etc.
Sometimes the results has decimal points. Do browsers support such values or is it better to round-up to whole values, for example using something like Math.floor(), before using the values?
Browsers do support decimal points, for example you could have 20.5%, or .5% etc
However – this tends to be limited to percentages, as you can’t really have a half of a pixel.
See, as this is basically a duplicate.
Are the decimal places in a CSS width respected?