Subversion Repositories SmartDukaan

Rev

Rev 25672 | Rev 25675 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25672 Rev 25673
Line 895... Line 895...
895
		}; 
895
		}; 
896
		for(const rating in ratings) {  
896
		for(const rating in ratings) {  
897
		  // 2
897
		  // 2
898
		  const starPercentage = (ratings[rating] / starTotal) * 100;
898
		  const starPercentage = (ratings[rating] / starTotal) * 100;
899
		  // 3
899
		  // 3
900
		  const starPercentageRounded = `${(Math.round(starPercentage / 10) * 10)}%`;
900
		  const starPercentageRounded = `${starPercentage}%`;
901
		  // 4
901
		  // 4
902
		  document.querySelector(`.${rating} .stars-inner`).style.width = starPercentageRounded; 
902
		  document.querySelector(`.${rating} .stars-inner`).style.width = starPercentageRounded; 
903
		}
903
		}
904
	});
904
	});
905
	
905