Malte Veerman 10 سال پیش
والد
کامیت
215cb51a8c
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      package/contents/scripts/units.js

+ 2 - 2
package/contents/scripts/units.js

@@ -24,14 +24,14 @@ function round(number, dec) {
 
 function toCelsius(degrees, currentUnit) {
     var float = parseFloat(degrees);
-    if (currentUnit == 1) { return float + 273.15; }
+    if (currentUnit == 1) { return float - 273.15; }
     if (currentUnit == 2) { return (float - 32) * 5 / 9; }
     return float;
 }
 
 function fromCelsius(degrees, newUnit) {
     var float = parseFloat(degrees);
-    if (newUnit == 1) { return round(float - 273.15); }
+    if (newUnit == 1) { return round(float + 273.15); }
     if (newUnit == 2) { return round(float * 9 / 5 + 32); }
     return round(float);
 }