Active
Project:
Units API
Version:
6.x-1.x-dev
Component:
units.xml
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2011 at 21:38 UTC
Updated:
10 Jun 2011 at 21:38 UTC
I have implemented Power units on a site and wanted to share. The base is one watt. Got the data from:
http://physics.nist.gov/Pubs/SP811/appenB9.html#POWER
function mymodule_unitsapi_load_alter(&$units) {
$units['watt'] = array(
'singular' => 'watt',
'plural' => 'watts',
'symbol' => 'W',
'factor' => '1',
'kind' => 'power',
'source' => 'http://physics.nist.gov/Pubs/SP811/contents.html'
);
$units['kilowatt'] = array(
'singular' => 'kilowatt',
'plural' => 'kilowatts',
'symbol' => 'kW',
'factor' => '1000',
'kind' => 'power',
'source' => 'http://physics.nist.gov/Pubs/SP811/contents.html'
);
$units['us mechanical horsepower'] = array(
'singular' => 'US horsepower (mechanical)',
'plural' => 'US horsepower (mechanical)',
'symbol' => 'hp', 'factor' => '7.456999E+02',
'kind' => 'power',
'source' => 'http://physics.nist.gov/Pubs/SP811/contents.html'
);
$units['metric mechanical horsepower'] = array(
'singular' => 'Metric horsepower (mechanical)',
'plural' => 'Metric horsepower (mechanical)',
'symbol' => 'hp',
'factor' => '7.354988E+02',
'kind' => 'power',
'source' => 'http://physics.nist.gov/Pubs/SP811/contents.html'
);
}