The Review

How can I remove the decimal points from my ratings?

To remove the decimal points from your ratings open lib/inc/ratings.php and find each occurrence of number_format and change the 1 within the brackets to 0, so for example this:

number_format( $GLOBALS['ghostpool_site_rating'], 1 ) 

Becomes:

number_format( $GLOBALS['ghostpool_site_rating'], 0 ) 

You will also need to make this change to The Review Plugin. The file is located at wp-content/plugins/the-review-plugin/shortcodes/gp_vc_hub_details.php.

Next open lib/scripts/user-ratings.js and find:

if ( ghostpool_rating.rating != '' ) {
    var score = ghostpool_rating.rating;
} else {
    var score = this.readCookie('ghostpool_rating_score_' + ghostpool_rating.post_id);
}

Replace with:

if ( ghostpool_rating.rating != '' ) {
    var score = Math.floor( ghostpool_rating.rating );
} else {
    var score = Math.floor( this.readCookie('ghostpool_rating_score_' + ghostpool_rating.post_id) );
}

Find

var score = Math.floor((((((offset / ghostpool_rating.rating_width) * 100) * ghostpool_rating.rating_number) / 100) * 10)) / 10;

Replace with:

var score = Math.floor((((offset / ghostpool_rating.rating_width) * 100) * ghostpool_rating.rating_number) / 100);

Find:

score = (Math.floor(((((((e.offsetX + 4) / ghostpool_rating.rating_width) * 100) * ghostpool_rating.rating_number) / 100) * 10)) / 10), 

Replace with:

score = (Math.floor((((e.offsetX + 4) / ghostpool_rating.rating_width) * 100) * ghostpool_rating.rating_number) / 100),

Find:

var offset = e.offsetX + 4;

Replace with:

var offset = ( Math.round( ( e.offsetX + 4 ) / 23.3 ) * 23.3 );

Find:

var position = ghostpool_rating.position;

Replace with:

var position = Math.round( ghostpool_rating.position / 23.3 ) * 23.3;

Find:

position = e.offsetX + 4;

Replace with:

position = Math.round( ( e.offsetX + 4 ) / 23.3 ) * 23.3;