You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
1
+
exportinterfaceOptions{
2
+
/**
3
+
Include plus sign for positive numbers. If the difference is exactly zero a space character will be prepended instead for better alignment.
5
4
6
-
@default false
7
-
*/
8
-
readonlysigned?: boolean;
5
+
@default false
6
+
*/
7
+
readonlysigned?: boolean;
9
8
10
-
/**
11
-
- If `false`: Output won't be localized.
12
-
- If `true`: Localize the output using the system/browser locale.
13
-
- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
14
-
- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
9
+
/**
10
+
- If `false`: Output won't be localized.
11
+
- If `true`: Localize the output using the system/browser locale.
12
+
- If `string`: Expects a [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
13
+
- If `string[]`: Expects a list of [BCP 47 language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (For example: `en`, `de`, …)
15
14
16
-
__Note:__ Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime.
15
+
__Note:__ Localization should generally work in browsers. Node.js needs to be [built](https://github.com/nodejs/node/wiki/Intl) with `full-icu` or `system-icu`. Alternatively, the [`full-icu`](https://github.com/unicode-org/full-icu-npm) module can be used to provide support at runtime.
17
16
18
-
@default false
19
-
*/
20
-
readonlylocale?: boolean|string|readonlystring[];
17
+
@default false
18
+
*/
19
+
readonlylocale?: boolean|string|readonlystring[];
21
20
22
-
/**
23
-
Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
21
+
/**
22
+
Format the number as [bits](https://en.wikipedia.org/wiki/Bit) instead of [bytes](https://en.wikipedia.org/wiki/Byte). This can be useful when, for example, referring to [bit rate](https://en.wikipedia.org/wiki/Bit_rate).
24
23
25
-
@default false
24
+
@default false
26
25
27
-
@example
28
-
```
29
-
import prettyBytes = require('pretty-bytes');
26
+
@example
27
+
```
28
+
import { prettyBytes } from 'pretty-bytes';
30
29
31
-
prettyBytes(1337, {bits: true});
32
-
//=> '1.34 kbit'
33
-
```
34
-
*/
35
-
readonlybits?: boolean;
30
+
prettyBytes(1337, {bits: true});
31
+
//=> '1.34 kbit'
32
+
```
33
+
*/
34
+
readonlybits?: boolean;
36
35
37
-
/**
38
-
Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
36
+
/**
37
+
Format the number using the [Binary Prefix](https://en.wikipedia.org/wiki/Binary_prefix) instead of the [SI Prefix](https://en.wikipedia.org/wiki/SI_prefix). This can be useful for presenting memory amounts. However, this should not be used for presenting file sizes.
39
38
40
-
@default false
39
+
@default false
41
40
42
-
@example
43
-
```
44
-
import prettyBytes = require('pretty-bytes');
41
+
@example
42
+
```
43
+
import { prettyBytes } from 'pretty-bytes';
45
44
46
-
prettyBytes(1000, {binary: true});
47
-
//=> '1000 bit'
45
+
prettyBytes(1000, {binary: true});
46
+
//=> '1000 bit'
48
47
49
-
prettyBytes(1024, {binary: true});
50
-
//=> '1 kiB'
51
-
```
52
-
*/
53
-
readonlybinary?: boolean;
48
+
prettyBytes(1024, {binary: true});
49
+
//=> '1 kiB'
50
+
```
51
+
*/
52
+
readonlybinary?: boolean;
54
53
55
-
/**
56
-
The minimum number of fraction digits to display.
54
+
/**
55
+
The minimum number of fraction digits to display.
57
56
58
-
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
57
+
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
59
58
60
-
@default undefined
59
+
@default undefined
61
60
62
-
```
63
-
import prettyBytes = require('pretty-bytes');
61
+
```
62
+
import { prettyBytes } from 'pretty-bytes';
64
63
65
-
// Show the number with at least 3 fractional digits
66
-
prettyBytes(1900, {minimumFractionDigits: 3});
67
-
//=> '1.900 kB'
64
+
// Show the number with at least 3 fractional digits
65
+
prettyBytes(1900, {minimumFractionDigits: 3});
66
+
//=> '1.900 kB'
68
67
69
-
prettyBytes(1900);
70
-
//=> '1.9 kB'
71
-
```
72
-
*/
73
-
readonlyminimumFractionDigits?: number;
68
+
prettyBytes(1900);
69
+
//=> '1.9 kB'
70
+
```
71
+
*/
72
+
readonlyminimumFractionDigits?: number;
74
73
74
+
/**
75
+
The maximum number of fraction digits to display.
75
76
76
-
/**
77
-
The maximum number of fraction digits to display.
77
+
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
78
78
79
-
If neither `minimumFractionDigits` or `maximumFractionDigits` are set, the default behavior is to round to 3 significant digits.
79
+
@defaultundefined
80
80
81
-
@default undefined
81
+
```
82
+
import { prettyBytes } from 'pretty-bytes';
82
83
83
-
```
84
-
import prettyBytes = require('pretty-bytes');
84
+
// Show the number with at most 1 fractional digit
85
+
prettyBytes(1920, {maximumFractionDigits: 1});
86
+
//=> '1.9 kB'
85
87
86
-
// Show the number with at most 1 fractional digit
87
-
prettyBytes(1920, {maximumFractionDigits: 1});
88
-
//=> '1.9 kB'
89
-
90
-
prettyBytes(1920);
91
-
//=> '1.92 kB'
92
-
```
93
-
*/
94
-
readonlymaximumFractionDigits?: number;
95
-
}
88
+
prettyBytes(1920);
89
+
//=> '1.92 kB'
90
+
```
91
+
*/
92
+
readonlymaximumFractionDigits?: number;
96
93
}
97
94
98
95
/**
@@ -102,7 +99,7 @@ Convert bytes to a human readable string: `1337` → `1.34 kB`.
0 commit comments