[Solved] Celsius to fahrenheit android

[ad_1]

In addition to the answers about parsing as float etc, note that setText is overloaded. When it takes an int, it is a resource Id, so make a string and give it that:

Instead of:

holder.textItem.setText(convertCelsiusToFahrenheit(...));

Do:

holder.textItem.setText(String.format("%d", convertCelsiusToFahrenheit(...)));

Or:

holder.textItem.setText(String.format("%d\x00B0 f", convertCelsiusToFahrenheit(...)));

Should give you “10° f” (untested)

[ad_2]

solved Celsius to fahrenheit android