Skip to content

Commit 9272bc2

Browse files
committed
Fix
1 parent c6bcb8c commit 9272bc2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

units.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* @const
44
* @type {number}
55
*/
6-
export const BYTES_PER_KB = 1024;
6+
export const bytesPerKb = 1024;
77

88
/**
99
* Convert bytes to megabytes.
1010
* @param {number} bytes - The number of bytes.
1111
* @return {number} The equivalent number of megabytes.
1212
*/
1313
export function bytesToMb(bytes) {
14-
return bytes / BYTES_PER_KB / BYTES_PER_KB;
14+
return bytes / bytesPerKb / bytesPerKb;
1515
}
1616

1717
/**
@@ -20,7 +20,7 @@ export function bytesToMb(bytes) {
2020
* @return {number} The equivalent number of gigabytes.
2121
*/
2222
export function bytesToGb(bytes) {
23-
return bytes / BYTES_PER_KB / BYTES_PER_KB / BYTES_PER_KB;
23+
return bytes / bytesPerKb / bytesPerKb / bytesPerKb;
2424
}
2525

2626
/**
@@ -29,7 +29,7 @@ export function bytesToGb(bytes) {
2929
* @return {number} The equivalent number of bytes.
3030
*/
3131
export function mbToBytes(mb) {
32-
return mb * BYTES_PER_KB * BYTES_PER_KB;
32+
return mb * bytesPerKb * bytesPerKb;
3333
}
3434

3535
/**
@@ -38,7 +38,7 @@ export function mbToBytes(mb) {
3838
* @return {number} The equivalent number of gigabytes.
3939
*/
4040
export function mbToGb(mb) {
41-
return mb / BYTES_PER_KB;
41+
return mb / bytesPerKb;
4242
}
4343

4444
/**
@@ -47,7 +47,7 @@ export function mbToGb(mb) {
4747
* @return {number} The equivalent number of bytes.
4848
*/
4949
export function gbToBytes(gb) {
50-
return gb * BYTES_PER_KB * BYTES_PER_KB * BYTES_PER_KB;
50+
return gb * bytesPerKb * bytesPerKb * bytesPerKb;
5151
}
5252

5353
/**
@@ -56,5 +56,5 @@ export function gbToBytes(gb) {
5656
* @return {number} The equivalent number of megabytes.
5757
*/
5858
export function gbToMb(gb) {
59-
return gb * BYTES_PER_KB;
59+
return gb * bytesPerKb;
6060
}

0 commit comments

Comments
 (0)