Skip to content

Main content

Convert Electrical Resistance Source Code

Browse the implementation files for Convert Electrical Resistance.
@tool.io/tools/convert/electrical-resistance source ↗
tool.ts typescript
import { convertElectricalResistance as convertPortableElectricalResistance } from '@tool.io/tools/convert/electrical-resistance';
import { measureFactorOptions } from '../tool';
import { measureFactors } from './factors';

export const convertElectricalResistance = (
	value: number,
	from: string,
	to: string
) => convertPortableElectricalResistance(value, from, to) ?? '';

export const Tool: TypeTool = {
	name: 'Convert Electrical Resistance',
	slug: 'convert/electrical-resistance',
	tool: convertElectricalResistance,
	intro:
		'Convert electrical resistance between ohms, SI-prefixed ohms, abohms, and statohms.',
	i: [
		{
			example: '1',
			label: 'Value',
			placeholder: '1',
			type: 'number'
		},
		{
			example: 'kohm',
			label: 'From',
			placeholder: 'Select the source resistance unit',
			options: measureFactorOptions(measureFactors, 'kohm'),
			type: 'select',
			value: 'kohm'
		},
		{
			example: 'ohm',
			label: 'To',
			placeholder: 'Select the destination resistance unit',
			options: measureFactorOptions(measureFactors, 'ohm'),
			type: 'select',
			value: 'ohm'
		}
	],
	o: [
		{
			example: '1000',
			label: 'Electrical resistance',
			placeholder: 'Converted electrical resistance',
			render: 'textarea',
			type: 'number'
		}
	],
	swap: {
		inputs: [1, 2],
		name: 'Swap resistance units',
		state: false
	},
	alternative: [
		{
			title: 'Convert electric conductance',
			url: '/convert/electric-conductance'
		},
		{
			title: 'Convert electric potential',
			url: '/convert/electric-potential'
		},
		{
			title: 'Convert electric current',
			url: '/convert/electric-current'
		}
	],
	cite: [
		{
			title: 'SI derived units — BIPM',
			url: 'https://www.bipm.org/en/measurement-units/si-derived-units'
		},
		{
			title: 'NIST Guide to SI conversion factors',
			url: 'https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors'
		}
	]
};

export default Tool;

Description

Browse the implementation files for Convert Electrical Resistance.

References

  1. Tool.io on GitHub
  2. Tool.io TypeScript tools library

Similar or alternative tools