From 9b05dccf28d7ee51bc84cb0a582e71ce03bff11d Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 15 May 2014 14:19:48 -0700 Subject: [PATCH] tfw: correct formula to calculate electron volts --- modules/tfw.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/tfw.py b/modules/tfw.py index 8b2d891..cecf791 100644 --- a/modules/tfw.py +++ b/modules/tfw.py @@ -50,11 +50,12 @@ def tfw(phenny, input, fahrenheit=False, celsius=False, mev=False): temp = "{0:d}°F‽".format(int(tempf)) elif celsius: temp = "{0:d}°C‽".format(w.temperature) - elif mev: - tempev = (w.temperature + 273.15) * 8.617343e-5 * 1000 - temp = "%f meV‽" % tempev else: - temp = "{0:f} Meters‽".format((w.temperature + 273.15) * 8.617343e-5 * 12.39842) + tempev = (w.temperature + 273.15) * 8.6173324e-5 / 2 + if mev: + temp = "{0:f} meV‽".format(tempev * 1000) + else: + temp = "{0:f} Meters‽".format(tempev * 12.39842) if w.temperature < 6: remark = "IT'S FUCKING COLD"