more temperature units: Reaumur, cm^-1, kJ/mol, kcal/mol (really, I use

cm^-1)
This commit is contained in:
arcan1s 2014-08-29 02:19:34 +04:00
parent 0240dee6ea
commit 8ccad0b86c
2 changed files with 16 additions and 0 deletions

View File

@ -47,6 +47,17 @@ def getTemp(temp, unit):
temp = str(round(((float(temp) * 9.0 / 5.0) + 32.0), 1))
elif (unit == "Kelvin"):
temp = str(round((float(temp) + 273.15), 1))
elif (unit == "Reaumur"):
temp = str(round((float(temp) * 0.8), 1))
elif (unit == "cm^-1"):
kelvin = round((float(temp) + 273.15), 1)
temp = str(round((kelvin * 0.695), 1))
elif (unit == "kJ/mol"):
kelvin = round((float(temp) + 273.15), 1)
temp = str(round((kelvin * 8.31), 1))
elif (unit == "kcal/mol"):
kelvin = round((float(temp) + 273.15), 1)
temp = str(round((kelvin * 1.98), 1))
return temp

View File

@ -207,6 +207,11 @@ $m - uptime minutes without zero</string>
<string notr="true">Kelvin</string>
</property>
</item>
<item>
<property name="text">
<string notr="true">Reaumur</string>
</property>
</item>
</widget>
</item>
</layout>