DDF correct annote for battery voltage
The former yielded 20,0 instead 20.0 which is a invalid JS number.
@@ -24,8 +24,8 @@ static quint8 calculateBatteryPercentageRemaining(const Resource *r, ResourceIte
const int maxSize = 384;
auto jsEval = std::make_unique<char[]>(maxSize);
int ret = snprintf(jsEval.get(), maxSize,
- "const vmin = %.1f;"
- " const vmax = %.1f;"
+ "const vmin = %u;"
+ " const vmax = %u;"
" let bat = Attr.val;"
" if (bat > vmax) { bat = vmax; }"
@@ -36,7 +36,7 @@ static quint8 calculateBatteryPercentageRemaining(const Resource *r, ResourceIte
" if (bat > 100) { bat = 100; }"
" else if (bat <= 0) { bat = 1; }"
- " Item.val = bat;", vmin, vmax);
+ " Item.val = bat;", unsigned(vmin), unsigned(vmax));
DBG_Assert(ret < maxSize);
if (ret > 0 && ret < maxSize && jsEval[ret] == '\0')
