1
0
Fork 0
mirror of https://github.com/eosswedenorg/apt synced 2026-06-16 04:34:56 +02:00

Adding _includes/size.html

This commit is contained in:
Henrik Hautakoski 2019-12-03 15:23:10 +01:00
parent 7f34dd84f3
commit ca1a1ba2a1

12
_includes/size.html Normal file
View file

@ -0,0 +1,12 @@
{% assign map = "B,KB,MB,GB" | split: "," %}
{% assign v = include.input | to_integer %}
{% for suffix in map %}
{% if v < 1000.0 %}
{{ v | round: 2 }} {{ suffix }}
{% break %}
{% endif %}
{% assign v = v | divided_by: 1000.0 %}
{% endfor %}