0

I have the following code:

contract CheckBet is usingOraclize {
    struct Weather {
        uint curr_temperature;
        uint high_temperature;
        uint low_temperature;
    }
    Weather weather;

function get_weather_status() payable{
    Log("Oraclize query was sent, waiting for the answer.."); 
    (oraclize_query("URL","json(http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22).main.temp_min"));

}

//callback function for Oraclize
function __callback(bytes32 _myid, string _result) {
    require (msg.sender == oraclize_cbAddress());
    Log(_result);
    assign_value_to_weather[low_temperature]= parseInt(_result, 2); 
}

Please help me out.

0

If your parseInt(_result, 2) gives the right result (no idea if it does), just simply assign to the weather variable?

weather.low_temperature = parseInt(_result, 2);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.