-
Notifications
You must be signed in to change notification settings - Fork 15
fix: show 5 digits size in table info #461
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
Conversation
d97fcd0
to
8c0b073
Compare
8c0b073
to
4a38dc4
Compare
let result = (Number(value) / sizes[size].value).toFixed(precision); | ||
result = formatNumber(result); | ||
|
||
if (withLabel) { |
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.
Lets move this case and case with isSpeed
to another functions. Now it's pretty unclear what for this function is responsible.
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.
Do you suggest separating conditions? Or there shouldn't be logic with adding label in such function?
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 see it as two additional functions: one will give simple label, one will give /s
label.
function withSpeed(val) {
return withLabel(val)
}
function withLabel(val) {
return formatBytes(val)
}
@@ -0,0 +1,31 @@ | |||
import {formatBytes} from '../formatBytes'; | |||
|
|||
describe('formatBytes', () => { |
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.
Lets add test-cases with invalid data.
51ef43c
to
bd822de
Compare
bd822de
to
6377b21
Compare
Uh oh!
There was an error while loading. Please reload this page.