mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
fix: redundant units
This commit is contained in:
@@ -101,9 +101,6 @@ export default function NumericInputWithUnit(props: {
|
||||
};
|
||||
|
||||
const handlePrefixChange = (newPrefix: string) => {
|
||||
const oldPrefixValue = siPrefixes[prefix];
|
||||
const newPrefixValue = siPrefixes[newPrefix];
|
||||
|
||||
setPrefix(newPrefix);
|
||||
};
|
||||
|
||||
@@ -112,7 +109,7 @@ export default function NumericInputWithUnit(props: {
|
||||
const oldInputValue = inputValue;
|
||||
const oldUnit = unit;
|
||||
setUnit(newUnit);
|
||||
setPrefix('');
|
||||
setPrefix('Default prefix');
|
||||
|
||||
const convertedValue = Qty(oldInputValue * siPrefixes[prefix], oldUnit).to(
|
||||
newUnit
|
||||
|
@@ -10,19 +10,19 @@ const ohmsLawCalc: GenericCalcType = {
|
||||
{
|
||||
name: 'V',
|
||||
title: 'Voltage',
|
||||
unit: 'V',
|
||||
unit: 'volt',
|
||||
default: 5
|
||||
},
|
||||
{
|
||||
name: 'I',
|
||||
title: 'Current',
|
||||
unit: 'A',
|
||||
unit: 'ampere',
|
||||
default: 1
|
||||
},
|
||||
{
|
||||
name: 'R',
|
||||
title: 'Resistance',
|
||||
unit: 'Ω'
|
||||
unit: 'ohm'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
@@ -44,7 +44,7 @@ const voltageDropInWire: GenericCalcType = {
|
||||
{
|
||||
name: 'L',
|
||||
title: 'Length',
|
||||
unit: 'm',
|
||||
unit: 'meter',
|
||||
default: 1
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user