number_format() 경고좀 봐주세요

number_format() 경고좀 봐주세요

QA

number_format() 경고좀 봐주세요

답변 2

본문

Warning: number_format() expects parameter 1 to be double, string given in 파일경로 on line 91
 

 

 if($i>=3) $view[win_count][$i] = $data[id_select_count]-$i+2;
  else $view[win_count][$i] = $data[id_select_count]-$i+1;
  $view[point_sum][$i] = number_format($rank_by_ed_point[$i])." $jy_config[cf_unit_name]";
  $view[cuont][$i] = number_format($rank_by_ed_count[$i])." 명";  (91번째 라인 내용)
  $view[point][$i] = number_format($view_point[$i])." $jy_config[cf_unit_name]";

 

인데요..

91번째 라인을 해야 할까요? 

이 질문에 댓글 쓰기 :

답변 2

$rank_by_ed_count[$i] 요거 echo로 찍어보시면 아마 숫자 말고 다른게 들어가서 그럴것 같은데요, 

일단 에러 내용 확인하시고, 그게 아니면 그냥 아래 처럼 해도 아무 이상 없지 싶습니다.

$view[cuont][$i] = number_format($rank_by_ed_count[$i] + 0)." 명"; 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 2
© SIRSOFT
현재 페이지 제일 처음으로