safely convert float option to an int
authorJim Morris <morris@wolfman.com>
Sun, 23 Aug 2015 01:15:15 +0000 (18:15 -0700)
committerJim Morris <morris@wolfman.com>
Sun, 23 Aug 2015 01:15:15 +0000 (18:15 -0700)
src/modules/tools/temperaturecontrol/Thermistor.cpp

index 1e5eb17..a391c40 100644 (file)
@@ -321,7 +321,7 @@ bool Thermistor::set_optional(const sensor_options_t& options) {
             case 'I': this->c1= i.second; define_shh++; break;
             case 'J': this->c2= i.second; define_shh++; break;
             case 'K': this->c3= i.second; define_shh++; break;
-            case 'P': predefined= i.second; break;
+            case 'P': predefined= roundf(i.second); break;
         }
     }