Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Proste wyrażenie
-Skorp-
post
Post #1





Goście







Powiedzmy, że są dwie liczby 17 i 39.
Potrzbuje skryptu, który powie mi jakim %-em z liczby 39 jest liczba 17 (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
kossa
post
Post #2





Grupa: Zarejestrowani
Postów: 1 165
Pomógł: 9
Dołączył: 9.04.2002
Skąd: Toruń

Ostrzeżenie: (0%)
-----


@Skorp na matematyce się nie zna?

  1. <?php
  2. $jaki_procent=(17*100)/39;
  3. ?>


:-)

Łukasz


edit
wynik mozna jeszcze ładnie zaokrąglić (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
ceil

Ten post edytował kossa 7.08.2006, 20:46:16
Go to the top of the page
+Quote Post
-Gość-
post
Post #3





Goście







powiedzmy ze na tej lekcji bylem zachorowalem (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)


thx (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

A gdyby tak zaokraglalo w dol (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) ? a od .5 doiero w gore?
Go to the top of the page
+Quote Post
kossa
post
Post #4





Grupa: Zarejestrowani
Postów: 1 165
Pomógł: 9
Dołączył: 9.04.2002
Skąd: Toruń

Ostrzeżenie: (0%)
-----


Funkcje odpowiedzialne za zaokrąglanie:

floor

round

ceil

Łukasz
Go to the top of the page
+Quote Post
-Gość-
post
Post #5





Goście







thx round wyglada obiecujaco
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 15:04