-2

It is giving integer value.

If value is 15.6, it is showing 16 OR if value is 15.2, it is showing 15

How to do it? Please help

  • If it is in pixel it will get rounded off. Try giving values in percentage. Also provide what you have tried so that we can help you better. – Sushant Pimple Jan 24 '18 at 04:24
  • Welcome to SO. Please take a few minutes to read [ask] and [mcve] then edit your question to show relevant code and a properly detailed problem description – charlietfl Jan 24 '18 at 04:24
  • 1
    Possible duplicate of [Are the decimal places in a CSS width respected?](https://stackoverflow.com/questions/4308989/are-the-decimal-places-in-a-css-width-respected) – Sushant Pimple Jan 24 '18 at 04:26

1 Answers1

0

You may try using below method to get height

function getHeight(id){
    var bound = $("#"+id)[0].getBoundingClientRect();
    var height;
    if (bound.height) {
      height = bound.height;
    } else {
      height = bound.top - bound.bottom;
    }
    return height;
}
jeet427
  • 538
  • 3
  • 16