Hesap Makinesi

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Hesap Makinesi as PDF for free.

More details

  • Words: 252
  • Pages: 3
0
7 8 9 /
4 5 6 *
1 2 3 -
0 +/- . +
c


=
<script language="javascript1.2">/* dhtml calculator script� dynamic drive (www.dynamicdrive.com) for full source code, installation instructions, 100's more dhtml scripts, and terms of use, visit dynamicdrive.com */ var var var var var var var var

results='' previouskey='' re=/(\/|\*|\+|-)/ re2=/(\/|\*|\+|-){2}$/ re3=/.+(\/|\*|\+|-).+/ re4=/\d|\./ re5=/^[^\/\*\+].+\d$/ re6=/\./

function calculate(){ if (event.srcelement.tagname=="td"){ if (event.srcelement.innertext.match(re4)&&previouskey=="=") results='' if (result.innertext.match(re3)&&event.srcelement.innertext.match(re)){ if (!results.match(re5)){ result.innertext="error!" return } results=eval(results) if (results.tostring().length>=12&&results.tostring().match(re6)) results=results.tostring().substring(0,12) result.innertext=results } results+=event.srcelement.innertext if (results.match(re2)) results=results.substring(0,results.length-2)+results.charat(results.length-1) result.innertext=results } } function calculateresult(){ if (!results.match(re5)){ result.innertext="error!" return

} results=eval(results) if (results.tostring().length>=12&&results.tostring().match(re6)) results=results.tostring().substring(0,12) result.innertext=results }

function pn(){ if (result.innertext.charat(0)!='-') result.innertext=results='-'+result.innertext else if (result.innertext.charat(0)=='-') result.innertext=results=result.innertext*(-1) }

Related Documents