Jump to content

Decimal point


wiiner

Recommended Posts

To be honest, I don´t really understand what I have done. But understand what my problem is.

Here is my page: http://kymnevoistlus.clanteam.com/ennusta.php

 

The problem is you can insert only integer numbers, but I need to change that it would be possible to insert numbers like 11.4 .

 

Thank you for helping.

 

Here is the problematic part of the code:

  <tr>

        <td>

            ketas:

        </td>

        <td>

            <input type="text" name="ketas" value='<?php if(isset($_POST["ketas"])){echo $_POST["ketas"];}else{ echo "";} ?>' />

        </td>

                        <td>

                                <?php

              if(isset($_POST["arvuta1"])){

                  $ketas=str_replace(".", '', str_replace(".", '', $_POST["ketas"]));

                 

                  if(is_numeric($_POST["ketas"])){       

                    if($ketas==0){

                        echo "viga numbri valimisel...";

                    }else{

                        $tulemus7=(12.91*(pow(($ketas-4.0), 1.1)));

                        echo (int) "$tulemus7";

                    }       

                  }else{

                    echo "viga numbri valimisel...";

                  }

              }else{

                  echo " ";

              }

            ?>

        </td>       

      </tr>

Link to comment
https://forums.phpfreaks.com/topic/194304-decimal-point/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.