I have a question about using sprintf in php.
An equation returns a value of 0.6 but I always want it to display as three decimal places like so:
.600
As the data changes, it may result in something like: 0.567443 but I’d like it to display as:
.567
Always three decimal places, and never with a leading zero. I tried using sprintf('%00.3f',$percentage) but that didn’t work. It always places the leading zero.
One might call this cheating:
But it works.