Ciao.
Se io ad esempio devo fare il 10% di un numero.
Faccio come nella classica matemtica
per 10
fratto 100
oppure c'è una funzione ancora più veloce??
grazie!
Ciao.
Se io ad esempio devo fare il 10% di un numero.
Faccio come nella classica matemtica
per 10
fratto 100
oppure c'è una funzione ancora più veloce??
grazie!
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
ho bisogno che mi escano solo numeri interi.
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
non credo che c'è ne sia una
vabeh, altra cosa.
Messo che io faccia come ho detto io, come si arrotonda un numero??
cioè se dalla funzione esce 1,7, come faccio ad arrotondarlo a 2??
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
così giusto??
grazie mille ancora!Codice PHP:
//$numero = 1.8;
$result = ceil($numero);
echo"$result"; // che stamperà 2 vero??
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made
$dieci_percento_intero_di_n = round((float)$n*0.1,0);[supersaibal]Originariamente inviato da Manuelandro
Ciao.
Se io ad esempio devo fare il 10% di un numero.
Faccio come nella classica matemtica
per 10
fratto 100
oppure c'è una funzione ancora più veloce??
vabeh, altra cosa.
Messo che io faccia come ho detto io, come si arrotonda un numero??
cioè se dalla funzione esce 1,7, come faccio ad arrotondarlo a 2??
grazie! [/supersaibal]
![]()
esatto,in questo caso dovrebbe stamparti 2...[supersaibal]Originariamente inviato da Manuelandro
così giusto??
grazie mille ancora! [/supersaibal]Codice PHP:
//$numero = 1.8;
$result = ceil($numero);
echo"$result"; // che stamperà 2 vero??
ciao![]()
Si ma ricorda che il ceil (soffitto) di 1.1 è ancora 2 ....forse mi sembrerebbe meglio arrotondare a 1 con round.
uhm...ottimo![supersaibal]Originariamente inviato da JHammer
$dieci_percento_intero_di_n = round((float)$n*0.1,0);
[/supersaibal]
http://codecanyon.net/category/all?ref=Manuelandro
And I bet she told a million people that she'd stay in touch, Well all the little promises they dont mean much,When theres
memories to be made