Fix rounding issues in progress calculations
What does this MR do and why?
Fix rounding issues in progress calculations
In the previous MR we used .to_d
to solve the rounding issues !132718 (merged)
But, .to_d
is also not working as expected on linux instances
for few progress values(for 94 we were getting 93). This fix replaces .to_i
with .round
Problem Reported here - https://gitlab.com/gitlab-com/gitlab-OKRs/-/work_items/3377#note_1590851998
Issue: #426081 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Ensure
okrs_mvc
feature flag is enabled. https://docs.gitlab.com/ee/user/okrs.html
Feature.enabled(:okrs_mvc)
- Create a new Objective under Plan -> issues. Under
New issue
dropdown, selectnew objective
, give it a title. I made this one confidential but I don't think it matters. - Set the progress to 94. A system note is created that it was set to 94 now.(In previous versions on linux machines, you will see the value to be 93)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.