From 0c12faa7dd7c35ae96e525abc7eeb8a0b917bdb4 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Wed, 31 Oct 2012 12:39:02 -0700 Subject: [PATCH] Update all usage.csv templates to use 2 decimal places Change-Id: I54694beb39fdee39d59e9032e72201a520a9fcd1 --- .../dashboards/admin/overview/templates/overview/usage.csv | 4 ++-- .../project/overview/templates/overview/usage.csv | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openstack_dashboard/dashboards/admin/overview/templates/overview/usage.csv b/openstack_dashboard/dashboards/admin/overview/templates/overview/usage.csv index b13fcc023..87c1296ff 100644 --- a/openstack_dashboard/dashboards/admin/overview/templates/overview/usage.csv +++ b/openstack_dashboard/dashboards/admin/overview/templates/overview/usage.csv @@ -1,9 +1,9 @@ Usage Report For Period:,{{ usage.start|date:"b. d Y" }},/,{{ usage.end|date:"b. d Y" }} Active Instances:,{{ usage.summary.instances }} -CPU-HRs Used:,{{ usage.summary.vcpu_hours }} +CPU-HRs Used:,{{ usage.summary.vcpu_hours|floatformat:2 }} Total Active RAM (MB):,{{ usage.summary.memory_mb }} Total Disk Size:,{{ usage.summary.local_gb }} -Total Disk Usage:,{{ usage.summary.disk_gb_hours }} +Total Disk Usage:,{{ usage.summary.disk_gb_hours|floatformat:2 }} Tenant,VCPUs,RamMB,DiskGB,Usage(Hours) {% for u in usage.usage_list %}{{ u.tenant_id|addslashes }},{{ u.vcpus|addslashes }},{{ u.memory_mb|addslashes }},{{u.local_gb|addslashes }},{{ u.vcpu_hours|floatformat:2}} diff --git a/openstack_dashboard/dashboards/project/overview/templates/overview/usage.csv b/openstack_dashboard/dashboards/project/overview/templates/overview/usage.csv index a3f52bb35..3e2ecd5b2 100644 --- a/openstack_dashboard/dashboards/project/overview/templates/overview/usage.csv +++ b/openstack_dashboard/dashboards/project/overview/templates/overview/usage.csv @@ -1,11 +1,11 @@ Usage Report For Period:,{{ usage.start|date:"b. d Y" }},{{ usage.end|date:"b. d Y" }} Tenant ID:,{{ usage.tenant_id }} Total Active VCPUs:,{{ usage.summary.instances }} -CPU-HRs Used:,{{ usage.summary.vcpu_hours }} +CPU-HRs Used:,{{ usage.summary.vcpu_hours|floatformat:2 }} Total Active Ram (MB):,{{ usage.summary.memory_mb }} Total Disk Size:,{{ usage.summary.local_gb }} -Total Disk Usage:,{{ usage.summary.disk_gb_hours }} +Total Disk Usage:,{{ usage.summary.disk_gb_hours|floatformat:2 }} Name,VCPUs,RamMB,DiskGB,Usage(Hours),Uptime(Seconds),State -{% for s in usage.get_instances %}{{ s.name|addslashes }},{{ s.vcpus|addslashes }},{{ s.memory_mb|addslashes }},{{ s.local_gb|addslashes }},{{ s.hours }},{{ s.uptime }},{{ s.state|capfirst|addslashes }} +{% for s in usage.get_instances %}{{ s.name|addslashes }},{{ s.vcpus|addslashes }},{{ s.memory_mb|addslashes }},{{s.local_gb|addslashes }},{{ s.hours|floatformat:2 }},{{ s.uptime }},{{ s.state|capfirst|addslashes }} {% endfor %}