Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Rounding a Negative number Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: February 11 2012 at 08:09 | IP Logged Quote GadgetGuy

Just a little informational posting to help anyone trying to solve the problem I have been fighting for many months.

My Weather fetch processing has thrown Syntax Errors for over a year, and I always thought it was because I was getting errors from my ph_getURL() effort.

This morning, I got frustrated and started debugging the failures in earnest.

What I discovered was that when the WindChill was a negative number (eg, -3) that my

Code:
round({WINDCHILL},0)


function was yielding a SYNTAX ERROR.

Experimenting further, even a simple round(-3,0) fails.

By surrounding the value with "()", it works.

Thus:
round(({WINDCHILL}),0), or simply

round((-3),0)

works!


Edited by GadgetGuy - February 11 2012 at 08:09


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum