[prog-it] a proposito di euro convertitore ;)

  • From: "XXXX" <xxxxwebmaster@xxxxxxxxx>
  • To: <prog-it@xxxxxxxxxxxxx>
  • Date: Sat, 19 Jan 2002 21:13:29 +0100

date un occhiata a questo script che ho fatto per il mio sito ;) posto tutta
la pagina ;)
fatemi sapere che ne pensate ;)
hemmm siccome non ricordo in quale Ml ho gia' postato questo cod. chiedo
scusa se l'ho gia postato qui ;)
holaz
XXXX
The Official WebSite
www.xxxxwebmaster.cjb.net
Complimenti a chi ha vinto il Cellulare votando il mio sito!

<html>
<head>
<title>€uro</title>
<script language="JavaScript">
function click(){
if(event.button==2){
alert("cosa copi?????????furbone ;) XXXXWebMaster©")
    }
}
document.onmousedown=click
</script>



</head>

<body bgcolor="#000000">
  <center>
<div align="center">&nbsp;</div>
<div align="center"><font size="6" color="#ffffff"
face="Arial"><i>XXXX€uroConvertitore©</i></font></div>
<div align="center" style="width: 764; height: 211">
  <center>
  <table border="1" cellspacing="8" width="65%" height="163">
    <tr>
            <td width="678" height="1" bgcolor="#000000"><strong><b><font
face="Arial" size="2" color="#000000">Convertitore da
            Lire in Euro:</font></b></strong><br><form action="index.html"
method="post" onSubmit="convert(this);return false;">
              <input type="hidden" name="direction"
value="toeuro"></center><p align="left"><font face="Arial" size="2"
color="#ff0000"><strong><input type="text" name="input" value size="10">
              Lire =     <input type="text" name="result" value size="10">
Euro <input type="submit" Value="Calcola"> </strong></font><input
type="reset" value="Cancella">
</p>
            </form>
            <p align="left"><strong><b><font face="Arial" size="2"
color="#000000">Convertitore da Euro in Lire:</font></b></strong></p>
  <center>
            <form action="index.html" method="post"
onSubmit="convert(this);return false;">
              <input type="hidden" name="direction"
value="fromeuro"></center><p align="left"><font face="Arial" size="2"
color="#ff0000"><strong><input type="text" name="input" value size="10">
            Euro =  <input type="text" name="result" value size="10">  Lire
<input type="submit" Value="Calcola"> </strong></font><input type="reset"
value="Cancella">
</p>
            </form>
    </tr>
  </table>



  </center>



<script Language="javascript">
<!--
var val50 =1936.27
var dec5 =2
var val51 =(1/val50)
var dec =2

function kommaclean(string){
        i=string.indexOf(",");
        while(i != -1)
        {
                string = string.substring(0,i) + '.' + string.substring(i+1,
string.length);
                i=string.indexOf(",");
        }
        i=string.lastIndexOf(".");
        j=string.indexOf(".")
        while(j != i)
        {
                string = string.substring(0,j) + string.substring(j+1,
string.length);
                i=string.lastIndexOf(".");
                j=string.indexOf(".");
        }
        return string;
}
function convert(f){
        invalstring = f.input.value
        invalstring = kommaclean(invalstring)
        inval = parseFloat(invalstring);
        if (f.direction.value=='fromeuro'){
                decuit = 3;
                decin  = 3
;
        }else{
                decuit = 3;
                decin  = 3;

        }
        inval = parseFloat(formatfloat(inval, decin))
        if (!(inval>0)){
                uitval = 0;
                inval  = 0;
        }else{
                if (f.direction.value=='fromeuro'){
                uitval = inval * val50 + 0.005;
                }else{
                uitval = inval * val51 + 0.005;
                }
        }
        f.result.value=formatfloat(uitval,decuit);
        f.input.value=formatfloat(inval,decin);
}
dec = 3
function formatfloat(fl, dec){
        str=""+fl;
        i = str.indexOf(".");
        if (i<0){
                i=str.length;
                str=str+".00000000000";
        }else{
                if(i==0){
                        i=1;
                        str="0"+str;
                }else{
                        str=str+"00000000000";
                }
        }
        return str.substring(0,i+dec);
}
// XXXX®-->
</script>

</div>


</body>

</html>



Other related posts: