Skip to content

Commit

Permalink
Merge pull request kubernetes#425 from anvithks/SOattrib
Browse files Browse the repository at this point in the history
Added attribution to author of formatBytes() method
  • Loading branch information
kumarashit authored Sep 25, 2020
2 parents 6293c15 + ce73255 commit 3c7735e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/shared/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ export class Utils {
return ret + " " + unit;
}
/***
* Returns the capacity value in appropriate display units
* formatBytes(bytes, decimals) Returns the capacity value in appropriate display units
* @param bytes (byte)
* @param decimals (number) //defaults to 2
*
* As per https://stackoverflow.com/a/18650828/6303009
* by Aliceljm (https://stackoverflow.com/users/1596799/aliceljm)
*/
static formatBytes(bytes, decimals = 2) {
if (bytes === 0) return '0 Bytes';
Expand Down

0 comments on commit 3c7735e

Please sign in to comment.