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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

Very minor bug - mph to km/h conversion

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
Grimers
Posts: 240
Joined: Tue 24 Nov 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Very minor bug - mph to km/h conversion

Post by Grimers »

Hi Mark & others,

Just noticed that even though the gauges.js script is converting mph to km/h correctly, the actual output is showing 1 mph as 1.4 km/h, so it doesn't round to 2 km/h when using rounded values. Not a biggie just wondering if there's a reason for this?

Cheers,

Will
water01
Posts: 3257
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Very minor bug - mph to km/h conversion

Post by water01 »

I might not be understanding you correctly but my understanding of rounding is that if the number is less than 5 round down and if more than 5 round up, so I would say this is correct.
David
Image
User avatar
jpsc
Posts: 179
Joined: Tue 23 Aug 2011 6:06 pm
Weather Station: Davis Vantage Vue, belfryboy USB
Operating System: Raspbian Bullseye
Location: Wye valley, Herefordshire, UK
Contact:

Re: Very minor bug - mph to km/h conversion

Post by jpsc »

It's the 1.4kph that is wrong, it should be 1mph converted to 1.6kph rounding to 2kph
John Cooper

Cumulus 3 on RPi3 with SSD

http://weather.mountpleasanthouse.uk

Image
Mapantz
Posts: 1822
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Very minor bug - mph to km/h conversion

Post by Mapantz »

I get 1.4 kmh as my lowest value. All other values above it are correct when converting back to mph.

So yeah, it should be 1.6 kmh.
Image
Grimers
Posts: 240
Joined: Tue 24 Nov 2015 9:07 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 64-bit
Location: Newton Poppleford, Devon, UK
Contact:

Re: Very minor bug - mph to km/h conversion

Post by Grimers »

Thought so, thanks all. I have tried to change the rounding but no luck it's stuck at 1.4 km/h. I guess Mark may need to make a (hopefully) small change, but like I say it's very minor.
Post Reply