I have a situation where i'm giving width
to a div
dynamically using jQuery
. Everything is working good with moz and ff since they are taking 100/7+"%"
as 14.2857%
where as IE is taking it as 14.28%
which is screwing up my UI as 14.28*7 is only 99.96.
is there a solution to make my ie take three or four decimals?? I've tried rounding my output to three, also tried using toFixed(3)
which are not working.
Thanks in advance.
I would recommend that you work in pixels instead. Since you are using jQuery anyway, you have access to $(window).width() and $(screen).width(), or $(parentelement).width() so there's your 100%. Then all pixel measurements are guaranteed to be integer by definition.
then
Maybe not the solution you wanted but we have all our developers work in pixels as a standard. We find that works well in practice.