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

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 »

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: 1181
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 »

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 »

Thanks for the info. I have made the changes but still, have one decimal in the same places.
Herbaldew
Posts: 113
Joined: Sun 12 Mar 2017 8:33 pm
Weather Station: VP2+
Operating System: Raspberry Pi OS (64-bit)
Location: US Mid-Atlantic

Re: Temperature only displaying to one decimal point

Post by Herbaldew »

Try clearing your cache - it is working properly for me now.
User avatar
saratogaWX
Posts: 1181
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 »

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 »

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: 1181
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 »

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 »

Spot on, thanks!
Post Reply