소수점 계산 관련하여 정보
소수점 계산 관련하여본문
function merong() {
wr_5 = document.getElementById('wr_5');
wr_6 = document.getElementById('wr_6');
wr_28 = document.getElementById('wr_28');
wr_28.value = parseInt(wr_5.value) * parseInt(wr_6.value) * 2500;니다.
}
----------------------------------------------
자바 스크립트를 위와 같이 입력을 하고
------------------------------------------------
<B>가로</B>
<input type=text name=wr_5 id=wr_5 onchange="merong()" value="<?=$write[wr_5]?>" size="5" style="font-style:normal; font-weight:bold; font-size:10; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" maxlength="5" id="wr_5" itemname="556" />m X <b>세로</b>
<input type=text name="wr_6" id=wr_6 onchange="merong()" size="5" maxlength="5" itemname="555" value="<?=$write[wr_6]?>" style="font-style:normal; font-weight:bold; font-size:10; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" />m =
<input type=text name=wr_28 id=wr_28 size="15" onchange="merong3()" maxlength="5" itemname="557" value="<?=$write[wr_28]?>" style="font-style:normal; font-weight:bold; font-size:15; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" />원<br>
---------------------------------------------------------------------------------
이렇게 해서 입력을 받았는데요.
그런데...... 소수점 계산이 안되네요.
보여질때는 가로 "00" m * 세로 "00"m = "00"원
이렇게 출력이 되는 건데요.
가로 세로의 "00"을 입력시 소수점을 입력하면 정수만 즉 3.5 * 5.4를 계산하면
3*5*2500=37500 원이 나옵니다.
2500은 단가고요.
길이다 보니 소수점은 2자리수까지 가야 합니다. 어떻게 하면 계산을 할 수 있을 까요?
wr_5 = document.getElementById('wr_5');
wr_6 = document.getElementById('wr_6');
wr_28 = document.getElementById('wr_28');
wr_28.value = parseInt(wr_5.value) * parseInt(wr_6.value) * 2500;니다.
}
----------------------------------------------
자바 스크립트를 위와 같이 입력을 하고
------------------------------------------------
<B>가로</B>
<input type=text name=wr_5 id=wr_5 onchange="merong()" value="<?=$write[wr_5]?>" size="5" style="font-style:normal; font-weight:bold; font-size:10; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" maxlength="5" id="wr_5" itemname="556" />m X <b>세로</b>
<input type=text name="wr_6" id=wr_6 onchange="merong()" size="5" maxlength="5" itemname="555" value="<?=$write[wr_6]?>" style="font-style:normal; font-weight:bold; font-size:10; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" />m =
<input type=text name=wr_28 id=wr_28 size="15" onchange="merong3()" maxlength="5" itemname="557" value="<?=$write[wr_28]?>" style="font-style:normal; font-weight:bold; font-size:15; color:rgb(255,153,0); text-decoration:blink; border-width:3px; border-style:solid;" />원<br>
---------------------------------------------------------------------------------
이렇게 해서 입력을 받았는데요.
그런데...... 소수점 계산이 안되네요.
보여질때는 가로 "00" m * 세로 "00"m = "00"원
이렇게 출력이 되는 건데요.
가로 세로의 "00"을 입력시 소수점을 입력하면 정수만 즉 3.5 * 5.4를 계산하면
3*5*2500=37500 원이 나옵니다.
2500은 단가고요.
길이다 보니 소수점은 2자리수까지 가야 합니다. 어떻게 하면 계산을 할 수 있을 까요?
( select a.* , ( select sum(co_count) as co_count from g4_qa_choose where mb_id=a.mb_id and bo_table = 'g4_qa' ) as q_co_count from `g4_write_g4_qa` a where wr_parent = '190004' and wr_8 != '' and wr_is_comment = 1 and CONVERT(wr_7, UNSIGNED) >= 5 group by wr_content having max(wr_7) order by CONVERT(wr_7, UNSIGNED) desc limit 3 )
1055 : Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sir.a.wr_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
error file : /15sir/bbs/board.php