Skip to content

Commit

Permalink
Merge pull request #11008 from jzigmund/bz1365664-fix_floats_rounding
Browse files Browse the repository at this point in the history
Added rounding for Memory/CPU ratios in Cluster textual helper
  • Loading branch information
martinpovolny committed Sep 5, 2016
2 parents 2d451e2 + 5aa1e7c commit 7a9e063
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/helpers/ems_cluster_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ def textual_aggregate_vm_memory
{:label => _("Total Configured Memory"),
:value => _("%{number} (Virtual to Real Ratio: %{ratio})") %
{:number => number_to_human_size(@record.aggregate_vm_memory.megabytes, :precision => 2),
:ratio => @record.v_ram_vr_ratio}}
:ratio => @record.v_ram_vr_ratio.round(2)}}
end

def textual_aggregate_vm_cpus
{:label => _("Total Configured CPUs"),
:value => _("%{number} (Virtual to Real Ratio: %{ratio})") %
{:number => number_with_delimiter(@record.aggregate_vm_cpus), :ratio => @record.v_cpu_vr_ratio}}
{:number => number_with_delimiter(@record.aggregate_vm_cpus),
:ratio => @record.v_cpu_vr_ratio.round(2)}}
end

def textual_ems
Expand Down

0 comments on commit 7a9e063

Please sign in to comment.