Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Rounding Values?

Discussion of Ken True's web site templates

Moderator: saratogaWX

User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Rounding Values?

Post by William Grimsley »

Hi Ken,

I've gone onto http://php.net and had a look at this page: PHP: round - Manual

But, none of it makes any sense to me and I've tried lots of codes out, but nothing works.

This is the code, I'm working on. I'm trying to make the Wind Chill value round to 0.1C. At the moment, I'm only getting either 2C or 0.0C, nothing else.

Code: Select all

$chillC = round(($chillF - 32) / 1.8);
How does this work?

Thanks,

William
Last edited by William Grimsley on Thu 14 Mar 2013 9:23 pm, edited 1 time in total.
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Rounding Values?

Post by RayProudfoot »

William,

I've just looked at your website and the dewpoint is -1.1C. I'm not sure why you're asking this question but I hope you remember what Ken has said about him not being your personal advisor.

If PHP doesn't make any sense to you then just leave it alone until you do understand it. You don't seem to be able to resist tinkering with your pages. They're fine. Leave them alone and find something else to do.
Cheers,
Ray, Cheshire.

Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

RayProudfoot wrote:William,

I've just looked at your website and the dewpoint is -1.1C. I'm not sure why you're asking this question but I hope you remember what Ken has said about him not being your personal advisor.

If PHP doesn't make any sense to you then just leave it alone until you do understand it. You don't seem to be able to resist tinkering with your pages. They're fine. Leave them alone and find something else to do.
Ray, I didn't make myself, clear enough. This is beyond my ability, you may have not noticed, but most of my site is coded all by me. I'm only asking for a bit of help, so I can't see what the big deal is.

I'm 14, what do you expect? I'm not going to be a god on PHP, like Ken is! When I'm at school, I ask for help and I get it! So, why has it suddenly become true, that I can't ask for help anymore? :cry:

Ken, the page I'm actually stuck on, is here: http://www.newton-poppleford-weather.co.uk/wxmetar.php
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Rounding Values?

Post by RayProudfoot »

William,

If the Dew Point is already being displayed to one decimal place what are you trying to achieve?

You're asking Ken to help yet again when he's already made it abundantly clear to you that he's not your personal assistant.

If you want help just post the question without directing it to Ken. But as I said I don't understand why you need to make the change. :roll:
Cheers,
Ray, Cheshire.

Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

RayProudfoot wrote:William,

If the Dew Point is already being displayed to one decimal place what are you trying to achieve?

You're asking Ken to help yet again when he's already made it abundantly clear to you that he's not your personal assistant.

If you want help just post the question without directing it to Ken. But as I said I don't understand why you need to make the change. :roll:
Sorry, I've asked the wrong question. Please forgive me, I meant the Wind Chill not the Dew Point. :oops:
RayProudfoot
Posts: 3602
Joined: Wed 06 May 2009 6:29 pm
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
Location: Cheadle Hulme, Cheshire, England
Contact:

Re: Rounding Values?

Post by RayProudfoot »

I think you're out of luck. The Davis VP2 only displays Wind Chill to whole degrees so it's likely the Vantage Vue is the same.
Cheers,
Ray, Cheshire.

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Rounding Values?

Post by beteljuice »

William - over 400 posts and apparently learning very little about social interaction or coding !

From the php rounding example page you link to:
Example #1 round() examples
<?php
echo round(3.4); // 3
echo round(3.5); // 4
echo round(3.6); // 4
echo round(3.6, 0); // 4
echo round(1.95583, 2); // 1.96
echo round(1241757, -3); // 1242000
echo round(5.045, 2); // 5.05
echo round(5.055, 2); // 5.06
?>
Nowhere in your code did you say how many decimal places you wanted - so defaults to 0.
.... but, that is purely working with the number, to display eg. 2.0 you need to use another function on the rounded figure you just produced. (Which is also mentioned on the example page you quoted).

These are NOT saratogaWX problems, they are self-created william problems.
If everyone asked asked all the questions you do, by breaking as many things as you do, the web would grind to a halt !

Code: Select all

 but most of my site is coded all by me.
:lol: :lol: :lol: Then why are you harassing the good guys - Don't bother replying, it just wastes thread space .......
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

beteljuice wrote:Nowhere in your code did you say how many decimal places you wanted - so defaults to 0.
.... but, that is purely working with the number, to display eg. 2.0 you need to use another function on the rounded figure you just produced. (Which is also mentioned on the example page you quoted).
I'm not wanting to display 2.0C! I'm wanting to display the 'actual' wind chill. Anyway, I've posted my query on http://www.phphelp.com because you guys, won't help me!
These are NOT saratogaWX problems, they are self-created william problems.
If everyone asked asked all the questions you do, by breaking as many things as you do, the web would grind to a halt !

Code: Select all

 but most of my site is coded all by me.
:lol: :lol: :lol: Then why are you harassing the good guys - Don't bother replying, it just wastes thread space .......
I know these are NOT saratogaWX problems! Where does it say, they are? :bash:

Harrasing the good guys? Harrasing? I don't think so! I'm just having a nice helpful chat! :bash:

beteljuice, I don't see why you are making such a big deal about this. Can I just say that forums are for help, not anger?
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Rounding Values?

Post by krmidas »

From an outsider's perspective, it seems like some of you folks are really picking on William. I don't understand the level of hostility that greets almost every one of his posts. Frankly, it's starting to feel mean-spirited and borderline bullying.

Why not choose to not respond, rather than repeatedly berate the young man?

-Tom
Tom Keramidas, Lake Zurich, IL, USA
Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

krmidas wrote:From an outsider's perspective, it seems like some of you folks are really picking on William. I don't understand the level of hostility that greets almost every one of his posts. Frankly, it's starting to feel mean-spirited and borderline bullying.

Why not choose to not respond, rather than repeatedly berate the young man?

-Tom
Correct! :clap:
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

Well, it must be some people, musn't it? I just got two replies back on http://www.phphelp.com and I've sorted the issue! They were very kind people, too! :D
Last edited by William Grimsley on Fri 15 Mar 2013 4:17 pm, edited 1 time in total.
water01
Posts: 3669
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10/11 64bit Synology NAS
Location: Burnham-on-Sea
Contact:

Re: Rounding Values?

Post by water01 »

Could that be because when advise is given it is ignored, even though he keeps asking the same type of question over an over again.

I think the phrase that comes to mind is "you can take a horse to water but you can't make him drink".
David
Image
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: Rounding Values?

Post by William Grimsley »

water01 wrote:Could that be because when advise is given it is ignored, even though he keeps asking the same type of question over an over again.

I think the phrase that comes to mind is "you can take a horse to water but you can't make him drink".
Advice being ignored? No way! I'm taking everything on board! If I thought that I was going to ignore everyone, I wouldn't be typing this post!
User avatar
krmidas
Posts: 215
Joined: Sat 03 Jul 2010 9:03 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows 10
Location: Lake Zurich, IL; USA
Contact:

Re: Rounding Values?

Post by krmidas »

water01 wrote:Could that be because when advise is given it is ignored, even though he keeps asking the same type of question over an over again.

I think the phrase that comes to mind is "you can take a horse to water but you can't make him drink".
And I can appreciate that (I'm a dad with 3 teenagers). Recently, it just seems to have crossed a point where the punishment exceeds the crime.

-Tom
Tom Keramidas, Lake Zurich, IL, USA
Image
User avatar
saratogaWX
Posts: 1238
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: Rounding Values?

Post by saratogaWX »

I can understand the perception that it appears we're being overly sensitive and harsh with Williams questions. We are not attempting to 'bully' William at all .. he has a long history on this (and on a forum to which he is now banned) of doing postings which are mainly due to self-inflicted coding errors and failing to respond meaningfully to advice/guidance given. By his own admission, he does have Aspberger syndrome which (according to Wikipedia)
Asperger syndrome (AS), also known as Asperger's syndrome or Asperger disorder, is an autism spectrum disorder (ASD) that is characterized by significant difficulties in social interaction, alongside restricted and repetitive patterns of behavior and interests. It differs from other autism spectrum disorders by its relative preservation of linguistic and cognitive development.
All of which is evidenced by his interactions on the forums.

It's just that many of us (me included) have ceased having patience dealing with the repetitive behavior after more than a year of the same kind of interactions. It was strongly hoped that William would benefit and learn from the interactions and better cope with his environment and better understand the social cues offered, but sadly, little such improvement has been seen and he continues to post questions about trivial coding errors he creates or offers advice where his subject knowledge is fundamentally flawed (though the latter has substantially mitigated in recent history). So.. I have stopped responding to his self-inflicted coding questions and/or trivial stylistic questions. I will respond to errata in the template support scripts (if they are unmodified from the distributed versions).
Post Reply