Skip to content

Commit 171ad3f

Browse files
committed
fix: better description and use of units
1 parent fcb4b68 commit 171ad3f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/tools/hdd-calculator/hdd-calculator.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ import InputCopyable from '../../components/InputCopyable.vue';
33
import type { Units } from './hdd-calculator.service';
44
import { getRealSize } from './hdd-calculator.service';
55
6-
const units = [
7-
{ value: 'kb', label: 'KB' },
6+
const dec_units = [
7+
{ value: 'kb', label: 'kB' },
88
{ value: 'mb', label: 'MB' },
99
{ value: 'gb', label: 'GB' },
1010
{ value: 'tb', label: 'TB' },
1111
{ value: 'pb', label: 'PB' },
1212
];
13+
const bin_units = [
14+
{ value: 'kb', label: 'KiB' },
15+
{ value: 'mb', label: 'MiB' },
16+
{ value: 'gb', label: 'GiB' },
17+
{ value: 'tb', label: 'TiB' },
18+
{ value: 'pb', label: 'PiB' },
19+
];
1320
1421
const claimedCapacity = ref(1);
1522
const claimedUnit = ref('tb');
@@ -23,15 +30,15 @@ const claimedUnit = ref('tb');
2330
<c-select
2431
v-model:value="claimedUnit"
2532
label="Unit:"
26-
:options="units"
33+
:options="dec_units"
2734
/>
2835

2936
<n-divider />
3037

3138
<InputCopyable
32-
v-for="({ value, label }) in units"
39+
v-for="({ value, label }) in bin_units"
3340
:key="value"
34-
:label="`Capacity in ${label}`"
41+
:label="`Capacity in ${label}:`"
3542
:value="getRealSize(claimedCapacity, claimedUnit as Units, value as Units).toFixed(5)"
3643
/>
3744
</div>

src/tools/hdd-calculator/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
44
export const tool = defineTool({
55
name: 'HDD calculator',
66
path: '/hdd-calculator',
7-
description: 'Compute real storage space (binary) from HDD Capacity (decimal)',
7+
description: 'Storage device manufacturers report capacities in decimal form (like GB), while operating systems and other software uses binary form (GiB), although still incorrectly using the decimal unit (GiB). This tool converts decimal form capacity into various binary forms.',
88
keywords: ['hdd', 'calculator', 'size', 'conversion', 'binary', 'decimal',
99
'gb', 'mb', 'tb',
1010
'gigabyte', 'gibibyte', 'megabyte', 'mebibyte', 'terabyte', 'tebibyte'],

0 commit comments

Comments
 (0)