* Fix decimal ratings not correctly displayed

* Fix aria label rounding ratings
This commit is contained in:
Albert Juhé Lluveras 2020-05-19 17:24:20 +02:00 committed by GitHub
parent 8f2003df4b
commit 0dc7e9e6f1
3 changed files with 4 additions and 2 deletions

View File

@ -19,7 +19,7 @@ const ProductRating = ( { className, product } ) => {
};
const ratingText = sprintf(
__( 'Rated %d out of 5', 'woo-gutenberg-products-block' ),
__( 'Rated %f out of 5', 'woo-gutenberg-products-block' ),
rating
);

View File

@ -195,6 +195,7 @@
position: absolute;
opacity: 0.5;
color: #aaa;
white-space: nowrap;
}
span {
overflow: hidden;
@ -211,6 +212,7 @@
right: 0;
position: absolute;
color: #000;
white-space: nowrap;
}
}
}

View File

@ -137,7 +137,7 @@ function getReviewRating( review ) {
<span style={ starStyle }>
{ sprintf(
__(
'Rated %d out of 5',
'Rated %f out of 5',
'woo-gutenberg-products-block'
),
rating