-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: resoruces should be displayed correctly. #3590
Conversation
90deba1
to
a719e67
Compare
src/shared/helpers/resources.js
Outdated
const coreValue = ( | ||
Math.round((+amount + Number.EPSILON) * 100) / 100 | ||
).toFixed(fixed); | ||
if (unit !== '' && prefixMap[unit]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are null, undefined and 0 possible here and acceptable? If not, we can just use: "if (unit && prefixMap[unit])"
src/shared/helpers/resources.js
Outdated
const value = (amount / prefixMap[unit]).toFixed(fixed); | ||
return { | ||
value: value, | ||
string: `${value}${infix}${unit}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be better to change the names to: "value" and "valueWithUnit" or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we can remove the whole object and return just string.
New changes are detected. LGTM label has been removed. |
New changes are detected. LGTM label has been removed. |
Description
Changes proposed in this pull request:
Related issue(s)
Definition of done
backlog#4567