Posted by tinker on June 10, 2011 at 9:38pm
1 follower
| Project: | Units API |
| Version: | 6.x-1.x-dev |
| Component: | units.xml |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
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
<?php
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'
);
}
?>