render cm_to_m

This commit is contained in:
Laura Klünder 2023-11-05 14:17:05 +01:00
parent 25a2bd7f2d
commit a48a3914d3
2 changed files with 6 additions and 1 deletions

View file

@ -92,7 +92,7 @@
<tr>
<td>{% mesh_node entry.peer %}</td>
<td>{{ entry.rssi }}</td>
<td>{{ entry.distance }}</td>
<td>{{ entry.distance | m_to_cm }}</td>
</tr>
{% endfor %}
</table>

View file

@ -18,3 +18,8 @@ def mesh_node(context, bssid):
'<a href="{url}">{bssid}</a>',
url=reverse('control.mesh.node.detail', kwargs={"pk": bssid}), bssid=bssid
)
@register.filter()
def m_to_cm(value):
return "%.2fm" % (int(value)/100)