Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
fix: kilo prefix should be lower case #70
Browse files Browse the repository at this point in the history
  • Loading branch information
fknop committed Oct 24, 2018
1 parent 130e7d2 commit 2291842
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/math/bytes.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Pipe, PipeTransform } from '@angular/core';
import { isNumberFinite, isPositive, isInteger, toDecimal } from '../utils/utils';

export type ByteUnit = 'B' | 'KB' | 'MB' | 'GB' | 'TB';
export type ByteUnit = 'B' | 'kB' | 'MB' | 'GB' | 'TB';


@Pipe({
Expand All @@ -11,8 +11,8 @@ export class BytesPipe implements PipeTransform {

static formats: { [key: string]: { max: number, prev?: ByteUnit } } = {
'B': {max: 1024},
'KB': {max: Math.pow(1024, 2), prev: 'B'},
'MB': {max: Math.pow(1024, 3), prev: 'KB'},
'kB': {max: Math.pow(1024, 2), prev: 'B'},
'MB': {max: Math.pow(1024, 3), prev: 'kB'},
'GB': {max: Math.pow(1024, 4), prev: 'MB'},
'TB': {max: Number.MAX_SAFE_INTEGER, prev: 'GB'}
};
Expand Down

0 comments on commit 2291842

Please sign in to comment.