love19801 Posted October 11, 2013 Share Posted October 11, 2013 (edited) //calcualte the discount $pounds = $kilo * 0.453592 // apply current formatting to the dollar and percent amounts $pounds_formatting = number_format($pounds, 2); //calcualte the discount $kilo = $pounds * 2.20462 //apply current formatting to the dollar and percent amounts $k_ilograms_formatting = number_format($k_ilograms,2); this is my code its not working Additional Details 1) gallons to liters(distance) 2) pounds to kilograms(volume) 3) pounds to kilograms(weight) 4) Fahrenheit to Celsius(temp) thank you Edited October 11, 2013 by ignace Quote Link to comment https://forums.phpfreaks.com/topic/282882-need-help-on-my-my-php-code-need-to-convert-metric-conversion/ Share on other sites More sharing options...
requinix Posted October 11, 2013 Share Posted October 11, 2013 Not working how? You can't just post code somewhere and tell people to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/282882-need-help-on-my-my-php-code-need-to-convert-metric-conversion/#findComment-1453515 Share on other sites More sharing options...
Barand Posted October 11, 2013 Share Posted October 11, 2013 I think it will work better if you switch those constants round. $pounds = $kilo*2.20462; $kilo = $pounds*0.453592; Quote Link to comment https://forums.phpfreaks.com/topic/282882-need-help-on-my-my-php-code-need-to-convert-metric-conversion/#findComment-1453523 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.