Wednesday, January 27, 2010

Re: [jQuery] Re: Removing percentage after dot - font-size: 30.6207px

I think that using Math.round() would suit best your needs:

$(".ui-selected").css('font-size', Math.round(maxFont * percentage) + "px");

parseInt(12.9) // 12
Math.round(12.9) // 13
--
Massimo Lombardo
Linux user #437712

No comments: