From 280748685778817ff588dad2f84e26372a0b3586 Mon Sep 17 00:00:00 2001 From: t123yh Date: Sun, 27 Aug 2017 18:59:56 +0800 Subject: [PATCH] Display a slash when a problem has no submission. --- views/problems.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/problems.ejs b/views/problems.ejs index ab4554d..51b5fc3 100644 --- a/views/problems.ejs +++ b/views/problems.ejs @@ -142,7 +142,7 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); <%= problem.ac_num %> <%= problem.submit_num %> - <%= ((problem.ac_num / problem.submit_num * 100) || 0).toFixed(2) %>% + <%= problem.submit_num != 0 ? (((problem.ac_num / problem.submit_num * 100) || 0).toFixed(2) + '%') : '-' %> <% } %> <% } %>