Script De Financiamento
#1
Posted 01/09/2004, 09:22
a base de calculo seria +ou- parecida c/ essa.
(100*total)/100);
(total+50)*0.2128))
(total+50)*0.1575))
(total+50)*0.1102))
(total+50)*0.1039))
desde já grato.
#2
Posted 01/09/2004, 09:58
<script>
function calcula(parcela){
var valor= parseFloat(document.getElementById("avista").value);
var parcela= parseFloat(parcela);
document.getElementById("resultado").value = (valor+50)*parcela;
}
</script>
<font face="Verdana" size="2">
Digite aqui o valor a vista:<br>
<input type="text" id="avista">
<br>
<select name="parcelas" size="1" onchange="calcula(this.value)">
<option value="">Selecione....</option>
<option value="0.2128">Valor 1</option>
<option value="0.1575">Valor 2</option>
<option value="0.1102">Valor 3</option>
<option value="0.1039">Valor 4</option>
</select>
<br>
<hr size="1" color="gray">
Resultado:
<input type="text" id="resultado" readonly>
flws.
Edição feita por: Tx.NET, 01/09/2004, 09:59.
-rwxr-xr-- 1 fmaynnard user 9666 nov 28 00:00 hell
> shutdown -h now
#3
Posted 01/02/2012, 14:14
vê c é isso q vc queria:
<script>
function calcula(parcela){
var valor= parseFloat(document.getElementById("avista").value);
var parcela= parseFloat(parcela);
document.getElementById("resultado").value = (valor+50)*parcela;
}
</script>
<font face="Verdana" size="2">
Digite aqui o valor a vista:<br>
<input type="text" id="avista">
<br>
<select name="parcelas" size="1" onchange="calcula(this.value)">
<option value="">Selecione....</option>
<option value="0.2128">Valor 1</option>
<option value="0.1575">Valor 2</option>
<option value="0.1102">Valor 3</option>
<option value="0.1039">Valor 4</option>
</select>
<br>
<hr size="1" color="gray">
Resultado:
<input type="text" id="resultado" readonly>
flws.
Opa, to usando seu script, até fiz algumas personalizações, mas tenho dois problemas:
1 - Estou tendo problemas com o cáculo:
Se eu dividir 140 em 3 vezes, ficaria 48.032000000000004 cada parcela, o que daria 144.096000000000012,
mas se for 999, ficaria 3 de 265.1872 o que daria um total de 795.5616!!!
2 - Não consigo trocar o ponto por vírgula, nem formatar para aparecer os centavos (no resultado).
Veja meu código:
<script> function calcula(parcela){ var valor= parseFloat(document.getElementById("avista").value); var parcela= parseFloat(parcela); document.getElementById("resultado").value = (valor+50)*parcela; } </script> <font face="Verdana" size="2"> Digite aqui o valor do empréstimo:<br> <!-- Formata dados --> <script type="text/javascript"><!-- Original: Mario Costa (mariocosta@openlink.com.br) --> <!-- Bug fix: John Kiernan --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function currencyFormat(fld, milSep, decSep, e) { var isIE8 = false; if (window.ActiveXObject) { // IE // http://www.javascriptkit.com/javatutors/navigator.shtml if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x; var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number if (ieversion>=8) { isIE8 = true; } else if (ieversion>=7) { } else if (ieversion>=6) { } else if (ieversion>=5) { } } } var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if (isIE8 /*|| isChrome*/) { } else { var sep = 0; var key = ''; var i = j = 0; var len = len2 = 0; var strCheck = '0123456789'; var aux = aux2 = ''; var whichCode = (window.Event) ? e.which : e.keyCode; if (whichCode == 13) return true; // Enter if (whichCode == 8) return true; // Delete (Bug fixed) key = String.fromCharCode(whichCode); // Get key value from key code if (strCheck.indexOf(key) == -1) return false; // Not a valid key len = fld.value.length; for(i = 0; i < len; i++) if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break; aux = ''; for(; i < len; i++) if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i); aux += key; len = aux.length; if (len == 0) fld.value = ''; if (len == 1) fld.value = '0'+ decSep + '0' + aux; if (len == 2) fld.value = '0'+ decSep + aux; if (len > 2) { aux2 = ''; for (j = 0, i = len - 3; i >= 0; i--) { if (j == 3) { aux2 += milSep; j = 0; } aux2 += aux.charAt(i); j++; } fld.value = ''; len2 = aux2.length; for (i = len2 - 1; i >= 0; i--) fld.value += aux2.charAt(i); fld.value += decSep + aux.substr(len - 2, len); } return false; } } // End --> </script> <!-- Fim da formatação de dados --> <input type="text" id="avista"> <!-- onkeypress="return(currencyFormat(this,'',',',event))"> --> <br> <select name="parcelas" size="1" onchange="calcula(this.value)"> <option value="">Parcelas</option> <option value="0.3128">2x com juros de % ao mês.</option> <option value="0.2528">3x</option> <option value="0.1575">4x</option> <option value="0.1102">5x</option> <option value="0.1039">6x</option> <option value="0.1039">7x</option> <option value="0.1039">8x</option> <option value="0.1039">9x</option> <option value="0.1039">10x</option> <option value="0.1039">11x</option> <option value="0.1039">12x</option> </select> <br> <hr size="1" color="gray"> Resultado: <input type="text" id="resultado" readonly> </BODY> </HTML>
Little help please! :S
#4
Posted 18/03/2012, 05:43
#5
Posted 22/09/2017, 04:34
Costco Pharmacy Cialis Prices Amoxicillin Bmp 202 Blue Pill Cheap Cod Only Macrobid Medicine Miami
Prednisone Online Purchase online pharmacy Propecia Generic Finasteride
#6
Posted 06/10/2017, 21:05
Proscar Ot Propecia Buy Priligy 30mg order on line levitra Baclofene Comment Ca Marche Cialis Bestellen Rezeptfrei
#7
Posted 20/10/2017, 17:30
Amoxicillin Cough Syrup And 100 Mg Professional Viagra Generic Cialis Non Fa Effetto viagra Amoxicillin Ef Diazide
#8
Posted 02/11/2017, 09:52
Cialis 20mg Indications Cialis Once Day online pharmacy Q8h And 1g And Amoxicillin Singapore Sildenafil Citrate Tablets Free Trials Team Viagra
#9
Posted 23/11/2017, 18:59
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)