Bug #18150: converting functions
| From: | hagman at byteme dot com | Date: | Wed, 03 Jul 2002 19:48:50 +0000 |
| Subject: | Bug #18150: converting functions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13028@lists.php.net to get a copy of this message | ||
From: hagman@byteme.com
Operating system: Win Me
PHP version: 4.2.1
PHP Bug Type: Feature/Change Request
Bug description: converting functions
There are some functions to convert time and BinDec etc in PHP but i feel
that a whole bunch of functions are missing. for example Temperature
Converting functions (eg. included). and for speed, mass, energy etc all
of those.
# From Celsius
// To Fahrenheit
function celfar($c) {
return $c*1.8+32; }
// To Kelvin
function celkel($c) {
return $c+273.15; }
// To Rankine
function celran($c) {
return $c*1.8+491.67; }
// To Réaumur
function celrea($c) {
return $c*0.8; }
# From Fahrenheit
// To Celsius
function farcel($f) {
return ($f-32)*(5/9); }
// To Kelvin
function farkel($f) {
return ($f-32)*(5/9)+273.15; }
// To Rankine
function farran($f) {
return $f+459.67; }
// To Réaumur
function farrea($f) {
return ($f-32)*(4/9); }
# From Kelvin
// To Celsius
function kelcel($k) {
return $k-273.15; }
// To Fahrenheit
function kelfar($k) {
return ($k-273.15)*9/5+32; }
// To Rankine
function kelran($k) {
return $k*1.8; }
// To Réaumur
function kelrea($k) {
return ($k-273.15)*0.8; }
# From Rankine
// To Celsius
function rancel($r) {
return ($r*(5/9))-273.15; }
// To Fahrenheit
function ranfar($r) {
return $r-459.67; }
// To Kelvin
function rankel($r) {
return $r*(5/9); }
// To Réaumur
function ranrea($r) {
return ($r*(4/9))-218.52; }
# From Réaumur
// To Celsius
function reacel($re) {
return $re*1.25; }
// To Fahrenheit
function reafar($re) {
return $re*2.25+32; }
// To Kelvin
function reakel($re) {
return $re*1.25+273.15; }
// To Rankine
function rearan($re) {
return $re*2.25+491.67; }
--
Edit bug report at http://bugs.php.net/?id=18150&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18150&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18150&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18150&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18150&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18150&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18150&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18150&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18150&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18150&r=globals