Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.4.6 (build 3070) - 23 March 2020
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

Temperature only displaying to one decimal point

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
stevei
Posts: 15
Joined: Tue 01 Feb 2011 6:41 pm
Weather Station: La Crosse WS 2308
Operating System: Windows 10
Location: UK

Temperature only displaying to one decimal point

Post by stevei » Wed 18 Mar 2020 12:14 pm

Good morning all

I had a few problems last year and you were very helpful in sorting it out.

My station has been down for some time due to a fault and is now back up with a replacement display unit thanks to eBay. All is working well except that the "rainfall today", "this month" and "seasonal totals" only displays to one decimal point. When I initially open the web site they shown two, but when it updates it switches to one. Can anyone help?

My site is at www.steveianson.co.uk

User avatar
saratogaWX
Posts: 1028
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Temperature only displaying to one decimal point

Post by saratogaWX » Wed 18 Mar 2020 4:05 pm

In Settings.php, you have selected units

Code: Select all

$SITE['uomTemp'] = '°C';  // ='°C', ='°F'
$SITE['uomBaro'] = ' mb';    // =' hPa', =' mb', =' inHg'
$SITE['uomWind'] = ' mph';   // =' km/h', =' kts', =' m/s', =' mph'
$SITE['uomRain'] = ' in';     // =' mm', =' in'
In ajaxCUwx.js you have

Code: Select all

var useunits = 'M';         // 'E'=USA(English) or 'M'=Metric
.. change that to

Code: Select all

var useunits = 'E';         // 'E'=USA(English) or 'M'=Metric
Then later in that script where it says

Code: Select all

var uomTemp = '°F';
var uomWind = ' mph';
var uomBaro = ' inHg';
var uomRain = ' in';
var uomHeight = ' ft';
var dpBaro = 2;
var dpBaroNoU = 3; // for trends display
var dpRain = 2;
var dpWind = 1;
// later updated by the ajax fetch
var rTempUOM = 'F';
var rWindUOM = 'mph';
var rBaroUOM = 'inHg';
var rRainUOM = 'in';
var rHeightUOM = 'ft';
change that to be

Code: Select all

var uomTemp = '°C';
var uomWind = ' mph';
var uomBaro = ' mb';
var uomRain = ' in';
var uomHeight = ' ft';
var dpBaro = 1;
var dpBaroNoU = 3; // for trends display
var dpRain = 2;
var dpWind = 1;
// later updated by the ajax fetch
var rTempUOM = 'C';
var rWindUOM = 'mph';
var rBaroUOM = 'mb';
var rRainUOM = 'in';
var rHeightUOM = 'ft';
That should correct the AJAX update display.

stevei
Posts: 15
Joined: Tue 01 Feb 2011 6:41 pm
Weather Station: La Crosse WS 2308
Operating System: Windows 10
Location: UK

Re: Temperature only displaying to one decimal point

Post by stevei » Wed 18 Mar 2020 5:56 pm

Thanks for the info. I have made the changes but still, have one decimal in the same places.

Herbaldew
Posts: 88
Joined: Sun 12 Mar 2017 8:33 pm
Weather Station: VP2+
Operating System: Raspbian Buster
Location: US Mid-Atlantic

Re: Temperature only displaying to one decimal point

Post by Herbaldew » Wed 18 Mar 2020 6:19 pm

Try clearing your cache - it is working properly for me now.

User avatar
saratogaWX
Posts: 1028
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Temperature only displaying to one decimal point

Post by saratogaWX » Wed 18 Mar 2020 6:28 pm

Another change in ajaxCUwx.js due to your settings .. change

Code: Select all

function convertTemp ( inrawtemp ) {
	// function expects temperature in C
	var rawtemp = cTempToC(inrawtemp);
	if (useunits == 'E') { // convert C to F
to

Code: Select all

function convertTemp ( inrawtemp ) {
	// function expects temperature in C
	var rawtemp = cTempToC(inrawtemp);
	if (rTempUOM == 'F') { // convert C to F
to fix the issue with a units conversion for the AJAX.

stevei
Posts: 15
Joined: Tue 01 Feb 2011 6:41 pm
Weather Station: La Crosse WS 2308
Operating System: Windows 10
Location: UK

Re: Temperature only displaying to one decimal point

Post by stevei » Thu 19 Mar 2020 8:44 am

Fantastic....Nearly there..... After all the changes suggested and clearing the cache the only anomaly is that the "feels like" temp is in deg. F

User avatar
saratogaWX
Posts: 1028
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Temperature only displaying to one decimal point

Post by saratogaWX » Thu 19 Mar 2020 5:25 pm

Another change to ajaxCUwx.js .. find

Code: Select all

function convertTempC ( rawtemp ) {
	// function expects temperature in C
	if (useunits == 'E') { // convert C to F
		return( (1.8 * rawtemp) + 32.0 );
and change to

Code: Select all

function convertTempC ( rawtemp ) {
	// function expects temperature in C
	if (rTempUOM == 'F') { // convert C to F
		return( (1.8 * rawtemp) + 32.0 );

stevei
Posts: 15
Joined: Tue 01 Feb 2011 6:41 pm
Weather Station: La Crosse WS 2308
Operating System: Windows 10
Location: UK

Re: Temperature only displaying to one decimal point

Post by stevei » Thu 19 Mar 2020 5:44 pm

Spot on, thanks!

Post Reply