jQuery.fn.stars = function() {
    jQuery(this).each(function() {
        // Get the value
        var val = parseFloat(jQuery(this).html());
        // Make sure that the value is in 0 - 5 range
        val = val > 5 ? 5 : (val < 0 ? 0 : val);
        // Calculate physical size
        var size = 16 * val;
        // Create stars holder
        var stars = jQuery('<span class="stars"><span></span></span>');
        // Adjust yellow stars' width
        stars.find('span').width(size);
        // Replace the numerical value with stars
        jQuery(this).replaceWith(stars);
    });
}
