Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-10-2012, 01:40 AM   PM User | #1
hash
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hash is an unknown quantity at this point
Question error in code :(

can anyone help me with this error please i dont quite understand whats wrong im getting the error Warning: number_format() expects parameter 1 to be double, string given on line 238 of common.htm i go to that line and this is what appears :return number_format($number, 0, '', ','); can anyone help me what am i missing
hash is offline   Reply With Quote
Old 10-10-2012, 02:18 AM   PM User | #2
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
$number should be exactly that a numeric value, what do you see if you
PHP Code:
echo $number
?
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Old 10-10-2012, 03:33 AM   PM User | #3
hash
New to the CF scene

 
Join Date: Oct 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hash is an unknown quantity at this point
Hi im sorry i dont quite understand im still kind of a beginner
could you please rephrase your answer?
my error code is this
Click image for larger version

Name:	Capture.PNG
Views:	22
Size:	1.8 KB
ID:	11614

i navigate to the desired line(not shown in the pic above) which is 238 i see this
Click image for larger version

Name:	Capture2.PNG
Views:	19
Size:	2.9 KB
ID:	11615

Thanks for taking your time out to help me
hash is offline   Reply With Quote
Old 10-10-2012, 04:59 AM   PM User | #4
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
what I mean is that we need to see the value of $number which is getting passed to that function.. so temp change the function to ..

PHP Code:
function prnintg($number){
      echo 
"\$number = {$number}";
      return 
number_format($number,0,'',',');

that may or may not give us a clue to whats happening, you also need to find the part of the code that calls prnintg($someval)
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:30 PM.


Advertisement
Log in to turn off these ads.