Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

[Implemented] Webtag parameter for rounding

A Forum to archive Cumulus MX development suggestions that have been rejected or solved by other means.
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

[Implemented] Webtag parameter for rounding

Post by freddie »

Is it possible to have a parameter that allows you to round output to a number of decimal places (including none) for tags that generate numeric output?
Freddie
Image
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Webtag parameter for rounding

Post by rogerthn »

Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Webtag parameter for rounding

Post by freddie »

Yes, I've seen that. But it only works for certain tags - hence the request for it to be extended to all numeric tags.
Freddie
Image
User avatar
rogerthn
Posts: 489
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Webtag parameter for rounding

Post by rogerthn »

Whoops, I should have read the title Cumulus MX Development Suggestions
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Webtag parameter for rounding

Post by mcrossley »

I'll take a look, but with over 700 tags it sounds like a lot of typing may be involved! :roll: So it maybe a back burner one for now.
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Webtag parameter for rounding

Post by freddie »

Sounds like an ideal candidate for an abstract parent class that the tags can inherit from - if tags are modelled using classes. I'm happy to do it - it's my bread and butter :-)
Freddie
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Webtag parameter for rounding

Post by mcrossley »

freddie wrote: Sat 22 Aug 2020 9:18 am if tags are modelled using classes.
You'd wish!
v4 is very different (if we ever see it), but no, v3 is a function per tag.
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Webtag parameter for rounding

Post by freddie »

Yes, I can see that now.

I've made the changes in a local copy of MX and they are running on my website https://www.hosiene.co.uk/weather/

I have only changed #wlatest, #wspeed and #wgust, as they are the ones I was interested in. Happy to do more, though - but it is really the wind speed ones I am interested in. I like the single decimal point for averages, but for instantaneous values I prefer rounded numbers.

Currently in MX you either have all rounded or all to 1 dp.

Let me know if you are interested in the changes and I will give them to you.
Freddie
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Webtag parameter for rounding

Post by mcrossley »

Now, should they be rounded or truncated to integers, the latter I think.

And, yes I use 1dp for wind average, and the integer value for latest, gust - as supplied by the VP2
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Webtag parameter for rounding

Post by freddie »

mcrossley wrote: Sat 22 Aug 2020 12:41 pm Now, should they be rounded or truncated to integers, the latter I think.

And, yes I use 1dp for wind average, and the integer value for latest, gust - as supplied by the VP2
Definitely rounded. 24.9 knots is more 25 knots than 24 :)
Latest gust converted to knots ends up a non-integer.
Freddie
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Webtag parameter for rounding

Post by mcrossley »

Implemented - you can now also set the decimals globally via the station settings page.
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: [Implemented] Webtag parameter for rounding

Post by freddie »

Awesome, thanks Mark. In my custom MX builds I have been using (for example):

Code: Select all

<#wspeed dp=0>
This will work now with the build untouched?

Also, for zero decimal places, are values rounded or truncated?
Freddie
Image
User avatar
mcrossley
Posts: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: [Implemented] Webtag parameter for rounding

Post by mcrossley »

It is implemented globally rather than per tag. So you can set the number of dp for wind speed (current, gust), wind run, and wind average independently of each other in the settings.
All other units also have their own dp settings.
User avatar
ConligWX
Posts: 1570
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: [Implemented] Webtag parameter for rounding

Post by ConligWX »

Hmm nice touch! though I thought Mark you only worked in Binary.

either the value of 1 or 0 would suffice :lol:
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
freddie
Posts: 2434
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: [Implemented] Webtag parameter for rounding

Post by freddie »

Okay, so that looks as if it will be storing in whatever precision you pick in the settings. So if you pick speed as 0 decimal places then it will be stored that way?
Freddie
Image
Post Reply