| ... | @@ -111,7 +111,7 @@ export const scaledSIFormatter = (unit = '', prefixOffset = 0) => { |
... | @@ -111,7 +111,7 @@ export const scaledSIFormatter = (unit = '', prefixOffset = 0) => { |
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (!units.length) {
|
|
if (!units.length) {
|
|
|
// eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings
|
|
// eslint-disable-next-line @gitlab/require-i18n-strings
|
|
|
throw new RangeError('The unit cannot be converted, please try a different scale');
|
|
throw new RangeError('The unit cannot be converted, please try a different scale');
|
|
|
}
|
|
}
|
|
|
|
|
|
| ... | @@ -122,7 +122,7 @@ export const scaledSIFormatter = (unit = '', prefixOffset = 0) => { |
... | @@ -122,7 +122,7 @@ export const scaledSIFormatter = (unit = '', prefixOffset = 0) => { |
|
|
* Returns a function that formats a number scaled using SI units notation.
|
|
* Returns a function that formats a number scaled using SI units notation.
|
|
|
*/
|
|
*/
|
|
|
export const scaledBinaryFormatter = (unit = '', prefixOffset = 0) => {
|
|
export const scaledBinaryFormatter = (unit = '', prefixOffset = 0) => {
|
|
|
// eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings
|
|
// eslint-disable-next-line @gitlab/require-i18n-strings
|
|
|
const multiplicative = ['Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];
|
|
const multiplicative = ['Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];
|
|
|
const symbols = ['', ...multiplicative];
|
|
const symbols = ['', ...multiplicative];
|
|
|
|
|
|
| ... | @@ -131,7 +131,7 @@ export const scaledBinaryFormatter = (unit = '', prefixOffset = 0) => { |
... | @@ -131,7 +131,7 @@ export const scaledBinaryFormatter = (unit = '', prefixOffset = 0) => { |
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (!units.length) {
|
|
if (!units.length) {
|
|
|
// eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings
|
|
// eslint-disable-next-line @gitlab/require-i18n-strings
|
|
|
throw new RangeError('The unit cannot be converted, please try a different scale');
|
|
throw new RangeError('The unit cannot be converted, please try a different scale');
|
|
|
}
|
|
}
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |