mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-23 09:01:56 +03:00
Merge pull request #75 from motdde/bugfix/strings.byteToSize
Bugfix: strings.bytesToSize method returns inaccurate decimal places
This commit is contained in:
commit
920fd2ef6e
@ -49,7 +49,7 @@ export const bytesToSize = (bytes, decimals = 2) => {
|
|||||||
|
|
||||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
|
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
return `${(bytes / Math.pow(k, i)).toFixed(dm)} ${sizes[i]}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getRemainingTime = (seconds) => {
|
export const getRemainingTime = (seconds) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user