Skip to content

Commit

Permalink
Merge pull request #293 from kati-kms/fix/MileStone#291
Browse files Browse the repository at this point in the history
[fix/MileStone#291] MileStone Progress Percentage Error
  • Loading branch information
hoonv authored Nov 13, 2020
2 parents f67a7c2 + 76a768a commit 9d076b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Filters {
Filter(criteria: CloseCriteria(), description: "닫힌 이슈들", isApply: false),
Filter(criteria: AuthorCriteria(name: AppData.user.name), description: "내가 작성한 이슈들", isApply: false),
Filter(criteria: AssignedCriteria(name: AppData.user.name), description: "나한테 할당된 이슈들", isApply: false),
Filter(criteria: CommentCriteria(), description: "내가 댓글을 남긴 이슈들", isApply: false)
]

func changeApplies() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class MileStoneCollectionViewCell: UICollectionViewCell {
}

private func calculateProgress(open: Int?, close: Int?) -> Int {
guard let open = open, let close = close, open + close != 0 else { return 0}
let percentage: Double = Double(close / (open + close))
return Int(ceil(percentage * 100))
guard let open = open, let close = close, (open + close) != 0 else { return 0}
let percentage: Double = Double(close) / Double(open + close) * 100
return Int(floor(percentage))
}

private func prettyPrintedDate(with dateString: String?) -> String? {
Expand Down

0 comments on commit 9d076b9

Please sign in to comment.