Jump to content
Fórum Script Brasil
  • 0

Outpup números inteiros


Robson Santiago
 Share

Question

Bom dia

Há dia estou tentando resolver esta questão aparentemente simples.

Preciso que o código abaixo apresente como resultado um número inteiro

No código abaixo

VALORV: 500

VALORH: 8
Resultado: 20.833333 preciso que arredonde para 21


Preciso que o resultado seja um número inteiro

se decimal > ou = a 5 arrendar para mais
se decimal < que 5 arredondar para menos

HTML

<form method="POST" oninput="resultado.value=

parseFloat(valor1.value)/parseFloat(valor2.value*3)">
<center>

<br>
<h5>

<input type="button" style="font-family:arial; fonf-weight:bold; font-size:12pt; width:100px; height:45px; background-color: #F5EEEE" value="VALORV">

<input type="tel" id="valor1" style="font-family:arial; fonf-weight:bold; font-size:15pt; text-align:center; width:90px; height:45px; background-color: #F5EEEE;" pattern="\([0-9]{2}\)[\s][0-9]{4}-[0-9]{4}" required="">
<p>

<br>

<input type="button" style="font-family:arial; fonf-weight:bold; font-size:12pt; width:100px; height:45px; background-color: #F5EEEE" value="VALORH">

<input type="tel" id="valor2" style="font-family:arial; fonf-weight:bold; font-size:15pt; text-align:center; width:90px; height:45px; background-color: #F5EEEE" pattern="\([0-9]{2}\)[\s][0-9]{4}-[0-9]{4}" required="">
</p>
<p>

<br>


</p><b>ADMX
<input output="" name="resultado" for="valor1 valor2" style="font-family:arial; fonf-weight:bold; font-size:12pt; border:0; width:50px; height:50px; background-color: #2c697e;"> macrogotas/min

<br>
<br>

<p></p>

<input type="reset" style="font-family:arial; fonf-weight:bold; font-size:10pt; width:90px; height:35px; background-color: #E9ECF5" value="Limpar"></b></h5><b>

</b>

</center><b>


</b>
</form>

</div><b>
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...