Fixed issue with converstion when SG was 0

This commit is contained in:
Magnus Persson 2022-03-13 10:37:01 +01:00
parent 16e91ec4f5
commit 2f8a324bfc

View File

@ -50,7 +50,11 @@ void tcp_cleanup() {
// //
// Convert sg to plato // Convert sg to plato
// //
double convertToPlato(double sg) { return 259 - (259 / sg); } double convertToPlato(double sg) {
if (sg)
return 259 - (259 / sg);
return 0;
}
// //
// Convert plato to sg // Convert plato to sg