<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta>
<style>
.calculator
{
width:200px;
height:300px;
background-color:#f7f7f7;
border:15px solid #cccccc;
margin:auto;
padding-left:5px;
padding-bottom:5px;
}
.calculator td
{
height:16.66%;
}
.calc_td_result
{
text-align:center;
}
.calc_result
{
width:90%;
text-align:right;
}
.calc_td_calculs
{
text-align:center;
}
.calc_calculs
{
width:90%;
text-align:center;
}
.calc_td_btn
{
width:25%;
height:100%;
}
.calc_btn
{
width:90%;
height:100%;
font-size:40px;
}
</style>
<script type="text/javascript">
calc_array = new Array();
var calcul=0;
var pas_ch=0;
function $id(id)
{
return document.getElementById(id);
}
function f_calc(id,n)
{
if(n=='ce')
{
init_calc(id);
}
else if(n=='=')
{
if(calc_array[id][0]!='=' && calc_array[id][1]!=1)
{
eval('calcul='+calc_array[id][2]+calc_array[id][0]+calc_array[id][3]+';');
calc_array[id][0] = '=';
$id(id+'_result').value=calcul;
calc_array[id][2]=calcul;
calc_array[id][3]=0;
}
}
else if(n=='+-')
{
$id(id+'_result').value=$id(id+'_result').value*(-1);
if(calc_array[id][0]=='=')
{
calc_array[id][2] = $id(id+'_result').value;
calc_array[id][3] = 0;
}
else
{
calc_array[id][3] = $id(id+'_result').value;
}
pas_ch = 1;
}
else if(n=='nbs')
{
if($id(id+'_result').value<10 && $id(id+'_result').value>-10)
{
$id(id+'_result').value=0;
}
else
{
$id(id+'_result').value=$id(id+'_result').value.slice(0,$id(id+'_result').value.length-1);
}
if(calc_array[id][0]=='=')
{
calc_array[id][2] = $id(id+'_result').value;
calc_array[id][3] = 0;
}
else
{
calc_array[id][3] = $id(id+'_result').value;
}
}
else
{
if(calc_array[id][0]!='=' && calc_array[id][1]!=1)
{
eval('calcul='+calc_array[id][2]+calc_array[id][0]+calc_array[id][3]+';');
$id(id+'_result').value=calcul;
calc_array[id][2]=calcul;
calc_array[id][3]=0;
}
calc_array[id][0] = n;
}
if(pas_ch==0)
{
calc_array[id][1] = 1;
}
else
{
pas_ch=0;
}
document.getElementById(id+'_result').focus();
return true;
}
function add_calc(id,n)
{
if(calc_array[id][1]==1)
{
$id(id+'_result').value=n;
}
else
{
$id(id+'_result').value+=n;
}
if(calc_array[id][0]=='=')
{
calc_array[id][2] = $id(id+'_result').value;
calc_array[id][3] = 0;
}
else
{
calc_array[id][3] = $id(id+'_result').value;
}
calc_array[id][1] = 0;
document.getElementById(id+'_result').focus();
return true;
}
function init_calc(id)
{
$id(id+'_result').value=0;
calc_array[id] = new Array('=',1,'0','0',0);
document.getElementById(id+'_result').focus();
return true;
}
function key_detect_calc(id,evt)
{
if((evt.keyCode>95) && (evt.keyCode<106))
{
var nbr = evt.keyCode-96;
add_calc(id,nbr);
}
else if((evt.keyCode>47) && (evt.keyCode<58))
{
var nbr = evt.keyCode-48;
add_calc(id,nbr);
}
else if(evt.keyCode==107)
{
f_calc(id,'+');
}
else if(evt.keyCode==109)
{
f_calc(id,'-');
}
else if(evt.keyCode==106)
{
f_calc(id,'*');
}
else if(evt.keyCode==111)
{
f_calc(id,'');
}
else if(evt.keyCode==110)
{
add_calc(id,'.');
}
else if(evt.keyCode==190)
{
add_calc(id,'.');
}
else if(evt.keyCode==188)
{
add_calc(id,'.');
}
else if(evt.keyCode==13)
{
f_calc(id,'=');
}
else if(evt.keyCode==46)
{
f_calc(id,'ce');
}
else if(evt.keyCode==8)
{
f_calc(id,'nbs');
}
else if(evt.keyCode==27)
{
f_calc(id,'ce');
}
return true;
}
</script>
</head>
<body>
<table class="calculator" id="calc">
<tr>
<td class="calc_td_result" colspan="4">
<input class="calc_result" id="calc_result" name="calc_result" onkeydown="javascript:key_detect_calc('calc',event);" readonly="readonly" type="text" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','ce');" type="button" value="CE" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','nbs');" type="button" value="?" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','%');" type="button" value="%" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','+');" type="button" value="+" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',7);" type="button" value="7" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',8);" type="button" value="8" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',9);" type="button" value="9" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','-');" type="button" value="-" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',4);" type="button" value="4" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',5);" type="button" value="5" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',6);" type="button" value="6" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','*');" type="button" value="x" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',1);" type="button" value="1" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',2);" type="button" value="2" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',3);" type="button" value="3" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','');" type="button" value="÷" />
</td>
</tr>
<tr>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc',0);" type="button" value="0" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','+-');" type="button" value="±" />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:add_calc('calc','.');" type="button" value="," />
</td>
<td class="calc_td_btn">
<input class="calc_btn" onclick="javascript:f_calc('calc','=');" type="button" value="=" />
</td>
</tr>
</table>
<script type="text/javascript">
document.getElementById('calc').onload=init_calc('calc');
</script>
</body>
</html>
<br /><br /><h2 style="text-align: left;">
Online Calculator For Calculate Instantly:</h2><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjClD23MoRG-feXz95olheBm0fmx6vYO7bNGcXBv_DwJMn-S1H7cmZ93K4jZcg7IiLvunxwW_6SPL5gKL5R1zitcDah0YCBvXsBE1NGxXHoUYKQdAtX6fIDuGBUwxi8VN9sh_IGaz79KIjj/s640/euro-870757_640.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Online Calculator For Calculate Instantly" border="0" data-original-height="426" data-original-width="640" height="426" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjClD23MoRG-feXz95olheBm0fmx6vYO7bNGcXBv_DwJMn-S1H7cmZ93K4jZcg7IiLvunxwW_6SPL5gKL5R1zitcDah0YCBvXsBE1NGxXHoUYKQdAtX6fIDuGBUwxi8VN9sh_IGaz79KIjj/w640-h426/euro-870757_640.jpg" title="Online Calculator For Calculate Instantly" width="640" /></a></div><br /><div><br /></div><div>Online Calculator For Calculate Instantly main purpose is to provide free online calculators that are quick, thorough, and handy in a variety of fields. We now offer about 200 calculators to assist you in rapidly "doing the math" in areas such as money, fitness, health, math, and others, and we are continuously creating more. Our ambition is to become the one-stop shop for those who need to perform rapid computations. Furthermore, we think that the internet should be a free source of knowledge. As a result, all of our products and services are entirely free and do not require registration.</div>