Skip to content

Commit c1e4425

Browse files
Arpan-KreetiArp-G
authored andcommitted
fix bug division with zero
1 parent f7c37d1 commit c1e4425

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/dashboard/lib/dashboard_web/live/main_live.html.leex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
Inserting Data
4444
<span class="records_inserted"> <strong> Record Inserted: </strong> <%= progress %> </span>
4545
<div class="progress">
46+
<%= percentage_progress = if(row_count == 0, do: 100, else: (progress / row_count) * 100) %>
4647
<div
4748
class="progress-bar progress-bar-striped progress-bar-animated bg-success"
4849
role="progressbar"
49-
style="width: <%= (progress / row_count) * 100 %>%">
50-
<span class="progress-percentage"> <%= Float.round((progress / row_count) * 100 , 2) %>% </span>
50+
style="width: <%= percentage_progress %>%">
51+
<span class="progress-percentage"> <%= Float.round(percentage_progress * 1.0 , 2) %>% </span>
5152
</div> %>
5253
</div>
5354

0 commit comments

Comments
 (0)