In jQuery, should i use parseFloat(el.width()) or parseInt(el.width(),10)? which one is more prefe

Posted by adardesign on Stack Overflow See other posts from Stack Overflow or by adardesign
Published on 2010-03-11T15:22:19Z Indexed on 2010/03/11 19:19 UTC
Read the original article Hit count: 285

I always had this question:
When i dont mind the exact floating number

Which one is preferred? like this code:

parseFloat
    someValue  = parseFloat(el.outerWidth())+parseFloat(ele2.css("marginRight")),
parseInt
    someValue  = parseInt(el.outerWidth(), 10)+parseInt(ele2.css("marginRight"), 10),

Which method is easier for the JS engine?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery