Jump to content

Format Float Value to Percentage


Benefitz

Recommended Posts

Hey guys,

 

Simple advice on this one.

 

I'd like to convert a float value to percentage... See the example below:

 

printf("%.2f",2/3);

 

So obviously 0.67 is expected, but I'd like to assume without reinventing the wheel,

that PHP has a nice function that prints 67% instead.

 

Anyone?

 

Thanks in advance

-Fitz.

 

Link to comment
https://forums.phpfreaks.com/topic/237742-format-float-value-to-percentage/
Share on other sites

  • 2 weeks later...

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.