Skip to content

Commit

Permalink
Added rounding for instructor rating in course popup (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyho authored Sep 30, 2024
1 parent 57b0f3f commit d858051
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion site/src/component/SearchPopup/SearchPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const SearchPopupContent: FC<SearchPopupProps> = (props) => {
{props.scores.map((score, i) => (
<div key={`search-popup-carousel-${i}`} className="search-popup-carousel search-popup-block">
<div>
<span className="search-popup-carousel-score">{score.score == -1 ? '?' : score.score}</span>
<span className="search-popup-carousel-score">
{score.score == -1 ? '?' : Number.isInteger(score.score) ? score.score : score.score.toFixed(2)}
</span>
<span className="search-popup-carousel-max-score">/ 5.0</span>
</div>
<Link to={`/${props.searchType == 'course' ? 'professor' : 'course'}/${score.key}`}>
Expand Down

0 comments on commit d858051

Please sign in to comment.