mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-09 17:56:16 +05:30
fix: redundant units
This commit is contained in:
parent
da7e2726fa
commit
2f0970c49b
4 changed files with 57 additions and 61 deletions
|
|
@ -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
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue