JayFF
Posts: 119
Joined: Fri Oct 03, 2014 1:03 am
Location: USA
Contact: Website

Is TRACK_DISTANCE Unit Configurable

Wed Mar 25, 2015 3:16 am

Hi All,

We use the Trip and Idle reports extensively to meet users' reporting requirements. We want to report the distances more accurately. Out of the box, the [DistanceGPS] cell has a unit of TRACK_DISTANCE, which reports rounded to the nearest mile. I have solved the requirement so far by setting the Unit to None and adding my own conversion and rounding routine. It works, but if I could configure the TRACK_DISTANCE unit to my exact requirements it would simplify creating reports are reduce the possibility for errors.

Thank you for your assistance.

Cheers,
Jay

User avatar
juanjogpsgate
GpsGate
Posts: 25
Joined: Wed Oct 08, 2014 12:49 pm
Location: Sweden
Contact: Website

RE: Is TRACK_DISTANCE Unit Configurable

Thu Mar 26, 2015 12:45 pm

Hi Jay,

If you want to have a more precise unit without rounding you could have used JOURNAL_DISTANCE which would have given you the distance with 1 decimal point.

If you still need more personalization, you can use the "$math.round" function which is standard in Javascript (https://developer.mozilla.org/en-US/doc ... Math/round).

For example, in my report have the distance in meters, I want to convert it to km and then have 4 decimal points as a result, the cell in the layout could have been personalized in this way: $math.round([TotalDistanceGps]/1000,4)

You can read more about the functions in the reporting guide here: http://docs.gpsgate.com/help/reporting/manual.pdf (from page 21 onwards)

I am curious, how did you solve your issue by the way?

JayFF
Posts: 119
Joined: Fri Oct 03, 2014 1:03 am
Location: USA
Contact: Website

RE: Is TRACK_DISTANCE Unit Configurable

Thu Mar 26, 2015 6:18 pm

Hi Juan,

Thank you for the reply. I solved the problem exactly the way you described, by using the $math.round function with a formula to convert the meters to miles. Since we use distance in a number of different reports, I was hoping that I could customize the TRACK_DISTANCE and use that as a shortcut instead of adding the function every where.

Cheers,
Jay

Return to “GpsGate Server - How to setup and use”