Bookmark this: tool.io/convert/electric-potential/source-code
Convert Electric Potential Source Code
Browse the implementation files for Convert Electric Potential.tool.ts typescript
import { convertElectricPotential as convertPortableElectricPotential } from '@tool.io/tools/convert/electric-potential';
import { measureFactorOptions } from '../tool';
import { measureFactors } from './factors';
export const convertElectricPotential = (
value: number,
from: string,
to: string
) => convertPortableElectricPotential(value, from, to) ?? '';
export const Tool: TypeTool = {
name: 'Convert Electric Potential',
slug: 'convert/electric-potential',
tool: convertElectricPotential,
intro:
'Convert electric potential difference between volts, SI-prefixed volts, statvolts, and abvolts.',
i: [
{
example: '120',
label: 'Value',
placeholder: '120',
type: 'number'
},
{
example: 'V',
label: 'From',
placeholder: 'Select the source electric-potential unit',
options: measureFactorOptions(measureFactors, 'V'),
type: 'select',
value: 'V'
},
{
example: 'mV',
label: 'To',
placeholder:
'Select the destination electric-potential unit',
options: measureFactorOptions(measureFactors, 'mV'),
type: 'select',
value: 'mV'
}
],
o: [
{
example: '120000',
label: 'Electric potential',
placeholder: 'Converted electric potential',
render: 'textarea',
type: 'number'
}
],
swap: {
inputs: [1, 2],
name: 'Swap electric-potential units',
state: false
},
alternative: [
{
title: 'Convert electric current',
url: '/convert/electric-current'
},
{
title: 'Convert electric charge',
url: '/convert/electric-charge'
},
{
title: 'Convert electrical resistance',
url: '/convert/electrical-resistance'
}
],
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 Electric Potential.