How to display temperature in degress celsius in app

时间:2015-07-28 15:47:48

标签: android

I have followed a tutorial on digitalphantom's website of creating a weather app. But the problem is I don't know how to convert the temperature to show degrees celsuis.

Here is the code:

String YQL = String.format("select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\"%s\")", location);

            String endpoint = String.format("https://query.yahooapis.com/v1/public/yql?q=%s&format=json", Uri.encode(YQL));

Sorry if this question is very vague or not a lot of info, but still learning myself and hoping someone would help me with this?

Thanks in advance.

1 个答案:

答案 0 :(得分:1)

The formula to convert Fahrenheit to Celsius is given by

C = (F - 32) x (5/9)

The Formula to convert Celsius to Fahrenheit is given by

F = C x (9/5) + 32

found here