Hi. Very green with the API. I would like to acquire the current temp_f and dewpoint_f with two decimal places. When I run my code it returns the values rounded to the nearest whole number. Could anyone guide on how to force the decimal places?
This is my site: http://www.psychroslc.com/data.php
I am using this code:
{'location'}->{'city'};
$temp_f = $parsed_json->{'current_observation'}->{'temp_f'};
$dewpoint_f = $parsed_json->{'current_observation'}->{'dewpoint_f'};
echo "Current temperature in ${location} is: ${temp_f}
Current dew point in ${location} is: ${dewpoint_f}\n";
?>
Thanks!
Steve
This is my site: http://www.psychroslc.com/data.php
I am using this code:
{'location'}->{'city'};
$temp_f = $parsed_json->{'current_observation'}->{'temp_f'};
$dewpoint_f = $parsed_json->{'current_observation'}->{'dewpoint_f'};
echo "Current temperature in ${location} is: ${temp_f}
Current dew point in ${location} is: ${dewpoint_f}\n";
?>
Thanks!
Steve