Using wconsole.php with Cumulus 1.9.4 the pressure reading is displayed with three places after the decimal. For example... 30.215 in
Is there a way to eliminate the thousandths place to just display it this way? 30.21 in
Thank you
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
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
Pressure as displayed in wconsole.php
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Pressure as displayed in wconsole.php
I don't think there's an option in Cumulus 1 to reduce the number of decimal places for Davis stations (I can't remember and can't easily look at the code at the moment). I don't know what wconsole.php is, but I think your only option would be to modify the code to do what you want. Someone who knows what wconsole.php is may be able to reply with something that's actually helpful to you.
Steve
-
- Posts: 25
- Joined: Sat 07 Mar 2015 12:25 am
- Weather Station: Vantage Pro II
- Operating System: Windows 7
- Location: Indiana
Re: Pressure as displayed in wconsole.php
This is it: http://wiki.sandaysoft.com/a/WeatherConsole
It was a user contribution but I dn't know who the devolper is or how to reach him/her.
It was a user contribution but I dn't know who the devolper is or how to reach him/her.
-
- Posts: 1183
- Joined: Fri 27 Jul 2012 11:29 am
- Weather Station: Chas O, Maplin N96FY, N25FR
- Operating System: rPi 3B+ with Buster (full)
Re: Pressure as displayed in wconsole.php
That Wiki article has author as David Jamieson, who is still a contributor, but I believe his JavaScript will simply output the figure as it appears in your realtime.txt file.tmabell wrote:It was a user contribution but I dOn't know who the devEolper is or how to reach him/her.
As far as I am aware, the simplest way in Javascript to implement your requirement is to multiply by 100, round that number, and then divide by 100.
Using jQuery library software as David does in WeatherConsole/wconsole.js (in code below where it says
Code: Select all
// DO NOT change anything below here.
Code: Select all
$("#pressure").html(rawdata[10]+" "+rawdata[15]);
Code: Select all
$("#pressure").html( (Math.round(100 * rawdata[10]) /100) +" "+rawdata[15]);
-
- Posts: 25
- Joined: Sat 07 Mar 2015 12:25 am
- Weather Station: Vantage Pro II
- Operating System: Windows 7
- Location: Indiana
Re: Pressure as displayed in wconsole.php
Thank you for the replies. Problem solved!
- mcrossley
- Posts: 12756
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Pressure as displayed in wconsole.php
Roughly, doesn't work for some edge cases. Try say 32.675 or 32.745.sfws wrote: and change toCode: Select all
$("#pressure").html( (Math.round(100 * rawdata[10]) /100) +" "+rawdata[15]);
-
- Posts: 25
- Joined: Sat 07 Mar 2015 12:25 am
- Weather Station: Vantage Pro II
- Operating System: Windows 7
- Location: Indiana
Re: Pressure as displayed in wconsole.php
A friend found that this works well:
Add this:
var newpress = Number(rawdata[10]).toFixed(2);
Change this:
$("#pressure").html(rawdata[10]+" "+rawdata[15]);
to this:
$("#pressure").html(newpress+" "+rawdata[15]);
Add this:
var newpress = Number(rawdata[10]).toFixed(2);
Change this:
$("#pressure").html(rawdata[10]+" "+rawdata[15]);
to this:
$("#pressure").html(newpress+" "+rawdata[15]);