This is one of those simple things that you'd think would be in the tool already, but just isn't.
Here's an example of how it's implemented in Excel. I would use the exact same approach.
https://www.extendoffice.com/documents/excel/1254-excel-convert-temperature-units.html