jimmykane / fit-parser

Parse your FIT files easily, directly from JS (Garmin, Polar, Suunto)
Other
92 stars 33 forks source link

Temp is actually in celsius... #7

Closed ScottChapman closed 5 years ago

ScottChapman commented 5 years ago

I think the fit file format has the temp in celsius. So the calculation to Fahrenheit is not correct...

jimmykane commented 5 years ago

hmmmm. Are you sure ? Some example? If I use the unit to Celcius it works.

ScottChapman commented 5 years ago

Right, if you look at your code (https://github.com/jimmykane/fit-parser/blob/master/src/fit.js#L24) your multiplier for fahrenheit is 1 and no conversion for Celsius...

var fitParser = new FitParser({
    force: true,
    speedUnit: 'mph',
    lengthUnit: 'mi',
    temperatureUnit: 'fahrenheit',
    elapsedRecordField: true,
    mode: 'cascade',
});

results in showing my average temp (for a June ride here in MA) a brisk 17

jimmykane commented 5 years ago

Yes you are right indeed. :-)

jimmykane commented 5 years ago

v1.6.8 contains the commit 6eacf809d546cd9e05c7381b1c8226da43b67e1a that should fix this.

Would be great if you can validate this

ScottChapman commented 5 years ago

works great!