Jump to content
Angel25

Numeros Decimais...

Recommended Posts

Angel25

Boas Tardes,

Eu queria que quando os números que vem da base de dados fossem para o site e aparecessem só com 2 casa decimais.

Ex:

Este número que vem da base de dados ----> 75.8462  queria que fica-se assim a aparecer no site ----> 75.85 ou 76

Será que me podem ajudar??

Share this post


Link to post
Share on other sites
ruimcosta
echo number_format("75.8462",2); // 75.75
echo number_format("75.8462",0); // 76


Abraços e beijinhos,Rui Costa

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.