fix: better description and use of units

This commit is contained in:
ShareVB committed 2024-12-15 19:13:34 +01:00
1 parent fcb4b682e1
commit 171ad3f199
2 files changed
+13 -6

No files matched your search

+12 -5
View File
@@ -3,13 +3,20 @@ import InputCopyable from '../../components/InputCopyable.vue';
import type { Units } from './hdd-calculator.service';
import { getRealSize } from './hdd-calculator.service';
const units = [
{ value: 'kb', label: 'KB' },
const dec_units = [
{ value: 'kb', label: 'kB' },
{ value: 'mb', label: 'MB' },
{ value: 'gb', label: 'GB' },
{ value: 'tb', label: 'TB' },
{ value: 'pb', label: 'PB' },
];
const bin_units = [
{ value: 'kb', label: 'KiB' },
{ value: 'mb', label: 'MiB' },
{ value: 'gb', label: 'GiB' },
{ value: 'tb', label: 'TiB' },
{ value: 'pb', label: 'PiB' },
];
const claimedCapacity = ref(1);
const claimedUnit = ref('tb');
@@ -23,15 +30,15 @@ const claimedUnit = ref('tb');
<c-select
v-model:value="claimedUnit"
label="Unit:"
:options="units"
:options="dec_units"
/>
<n-divider />
<InputCopyable
v-for="({ value, label }) in units"
v-for="({ value, label }) in bin_units"
:key="value"
:label="`Capacity in ${label}`"
:label="`Capacity in ${label}:`"
:value="getRealSize(claimedCapacity, claimedUnit as Units, value as Units).toFixed(5)"
/>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
export const tool = defineTool({
name: 'HDD calculator',
path: '/hdd-calculator',
description: 'Compute real storage space (binary) from HDD Capacity (decimal)',
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.',
keywords: ['hdd', 'calculator', 'size', 'conversion', 'binary', 'decimal',
'gb', 'mb', 'tb',
'gigabyte', 'gibibyte', 'megabyte', 'mebibyte', 'terabyte', 'tebibyte'],