diff --git a/src/helpers.cr b/src/helpers.cr index b3625b67..d0b6feec 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -320,3 +320,7 @@ def template_comments(root) return html end + +def number_with_separator(number) + number.to_s.reverse.gsub(/(\d{3})(?=\d)/, "\\1,").reverse +end diff --git a/src/views/watch.ecr b/src/views/watch.ecr index 1e15c156..4e75cc7e 100644 --- a/src/views/watch.ecr +++ b/src/views/watch.ecr @@ -81,9 +81,9 @@ function dismiss(target) {
-

<%= video.views %>

-

<%= video.likes %>

-

<%= video.dislikes %>

+

<%= number_with_separator(video.views) %>

+

<%= number_with_separator(video.likes) %>

+

<%= number_with_separator(video.dislikes) %>

Wilson Score : <%= video.wilson_score.round(4) %>

Rating : <%= rating.round(4) %> / 5

Engagement : <%= engagement.round(2) %>%