Fix use float when rounding bitrate/bandwidth

This commit is contained in:
JonnyWong16 2017-08-23 22:10:24 -07:00
parent aee752e04e
commit da3abf11a2

View file

@ -207,7 +207,7 @@ DOCUMENTATION :: END
<div class="dashboard-activity-poster-info-ip-address"> <div class="dashboard-activity-poster-info-ip-address">
Quality: Quality:
<% <%
br = helpers.cast_to_int(data['stream_bitrate']) or "Unknown" br = helpers.cast_to_float(data['stream_bitrate']) or "Unknown"
br_units = "kbps" br_units = "kbps"
if br != "Unknown" and br > 1000: if br != "Unknown" and br > 1000:
br = round(br / 1000, 1) br = round(br / 1000, 1)
@ -219,7 +219,7 @@ DOCUMENTATION :: END
IP: ${data['ip_address']} IP: ${data['ip_address']}
% if data['media_type'] != 'photo' and 'location' in data: % if data['media_type'] != 'photo' and 'location' in data:
<% <%
bw = helpers.cast_to_int(data['bandwidth']) or "Unknown" bw = helpers.cast_to_float(data['bandwidth']) or "Unknown"
bw_units = "kbps" bw_units = "kbps"
if bw != "Unknown" and bw > 1000: if bw != "Unknown" and bw > 1000:
bw = round(bw / 1000, 1) bw = round(bw / 1000, 1)