replace NaN by 0

This commit is contained in:
hpcwoess 2020-09-08 10:33:19 +02:00
parent 1e72349026
commit 70e2ec5672

View file

@ -66,6 +66,10 @@ function addPointsToTrack(track,body)
{
f = parseFloat(token.substring(0,10));
}
if(isNaN(f))
{
f=0.0;
}
track.trackData.points[track.trackData.points.length - 1].latitude = f;
num++;
}
@ -75,6 +79,10 @@ function addPointsToTrack(track,body)
{
f = parseFloat(token.substring(0,10));
}
if(isNaN(f))
{
f=0.0;
}
track.trackData.points[track.trackData.points.length - 1].longitude = f;
num++;
}
@ -84,6 +92,10 @@ function addPointsToTrack(track,body)
{
f = parseFloat(token.substring(0,10));
}
if(isNaN(f))
{
f=0.0;
}
track.trackData.points[track.trackData.points.length - 1].course = f;
num++;
}
@ -93,6 +105,10 @@ function addPointsToTrack(track,body)
{
f = parseFloat(token.substring(0,10));
}
if(isNaN(f))
{
f=0.0;
}
track.trackData.points[track.trackData.points.length - 1].speed = f;
num++;
}