Skip to content
Snippets Groups Projects
Commit e53e4d45 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'floating-avarage-commit-numbers' into 'master'

Show one digit after dot in commit_per_day value in charts page.

Closes #26512

See merge request gitlab-org/gitlab-ce!20896
parents 9b433c37 188692ad
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
---
title: Show one digit after dot in commit_per_day value in charts page.
merge_request:
author: msdundar
type: changed
Loading
Loading
@@ -18,7 +18,7 @@ module Gitlab
end
 
def commit_per_day
@commit_per_day ||= @commits.size / (@duration + 1)
@commit_per_day ||= (@commits.size.to_f / (@duration + 1)).round(1)
end
 
def collect_data
Loading
Loading
Loading
Loading
@@ -29,7 +29,7 @@ describe Gitlab::Graphs::Commits do
context 'with commits from yesterday and today' do
subject { described_class.new([commit2, commit1_yesterday]) }
describe '#commit_per_day' do
it { expect(subject.commit_per_day).to eq 1 }
it { expect(subject.commit_per_day).to eq 1.0 }
end
 
describe '#duration' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment