Remove the period and everything after it using jQuery

Posted by veryserious on Stack Overflow See other posts from Stack Overflow or by veryserious
Published on 2011-11-18T17:43:53Z Indexed on 2011/11/18 17:51 UTC
Read the original article Hit count: 125

Filed under:
|

Is there a way to remove the period and everything after it using jQuery? The numbers following the period vary in length, so it's not as simple as finding the length.

For example:

<span class="changethis">505.234</span> <span class="changethis">23.93</span>

Thanks for your help!

P.S. (bonus) If there is a way to round up if it's x.5 or higher that would be awesome. Not essential though.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about string