Data Field: Calculated Field

Started creating this app based on a user request (and also because I thought it would be a fun programming exercise) :)

This field allows to calculate formulas on the fly without having to program 1 letter yourself.

The following operators are availlable:
+ (plus) - (minus) * (multiply) / (divide) ^ (power)

The following variables are available:

heartrate, cadence, power, altitude, averagecadence, averageheartrate, averagepower, averagespeed, calories, heading, locationaccuracy, speed, distance, elapsedtime, energyexpenditure, timerTime, totalascent, totaldescent, trainingeffect, maxcadence, maxheartrate, maxpower, maxspeed

As format string use either:

%d format as a number
%.1f decimal with 1 digit (you can change the 1 by another number)

Example formula:
cadence / 2

The app will be available here (once it's approved): https://apps.garmin.com/en-US/apps/35a1c0dd-eb5c-4435-9ec7-a885802325c3
  • Hello, this is a nice app! Is there the possibility to save the calculated data on the fit file?
  • So I noticed a funny issue with the way Garmin Connect Mobile handles + characters in config strings. In both of our apps, I think entering something like 2 + 2 works properly -- at first. The string is stored and 4 is displayed, but when I go back and look at the config, I see mixed results. With my app, the + is replaced by a space. With your app, the default config string Cadence / 2 is displayed.

    I originally thought that the settings weren't being written properly, but in this case it's obvious that they just aren't being read back properly.

    Do you think this is an issue? I mean it works if you only configure the app once and never expect to read your config back. To get around this, I use "PLUS" for addition in my app.

    This doesn't seem to be a problem with GE or the simulator. I'm sure it has something to do with URL or HTML-safe encoding. Using angle brackets or percent characters causes even worse problems....

    It's funny because you can't type parentheses and other random characters in the forums, you can't type angle brackets in the store and you can't type all kinds of characters in the app config...
  • Actually I noticed that no matter what I type in your config, when I save it and go back, the default "cadence / 2" is always displayed. So maybe it's a different issue...
  • I don't notice that behaviour :) For me it properly saves, + symbols and all.... I don't know why it would fail for you, all i can think about is user locale settings...
    The only time when it resets settings is when you update to a new version of the app via garmin connect mobile. (known issue)
  • Huh weird. So I told people not to use "+" for nothing. >_>. I am in North America FWIW. Maybe it's iOS vs Android? I am on iOS.

    But try entering angle brackets or "%" in your config.... The former should give you an error page and the latter should clear your entire config. (Again it's not clear whether that's on the write or read, now that I think about it.)

    And the thing is that it doesn't really reset your settings. The settings work, it's just that when I look at them again, they appear to be defaults. But the defaults won't actually be applied until I save the config again.

    Same with the way "+" becomes " " in my config. The app will actually work until I resave the config (with the now-invalid formula).

    I did notice that entering "timertime" causes your app to crash. Hope that's not just me, as well.
  • the timertime was not just you, fixed that in the new version :)

    could be an ios thing, can enter % and go back and edit it, of course it does not parse to a number as I didn't implement the modulo operator