View Single Post
Old 02-04-2017, 02:15 AM   #80 (permalink)
skybolt
deviant
 
Join Date: Oct 2016
Location: Seattle, WA
Posts: 69

s2k - '02 Honda s2000
Thanks: 12
Thanked 47 Times in 35 Posts
The following is based on:
Code:
const char overFlowStr[] PROGMEM = "999999";


Code:
  reserveQuantity = doCalculate(instantIdx, tFuelEcon); //instant fuel economy
  if (doCalculate(instantIdx, tFuelEcon) > 999999) {
    text::stringOut(devLogSerial, PSTR("999999\",\n")); //infinte fuel economy, good for overflow and reasonable for anything above 999,999 (current overflow is 4,294,967.295 or (2^32)-1), check decimals is 999999 999.999 vs 999999.000? 
  } else {
  doOutputNumberJSON(reserveQuantity, 3, PSTR("\",\n")); // instantaneous fuel economy    
  }

Last edited by skybolt; 02-07-2017 at 10:45 PM..
  Reply With Quote
The Following User Says Thank You to skybolt For This Useful Post:
t vago (02-08-2017)