HI
I am working on some formula which results a 2 digit number as output.
The problem is when the result is 0, it returns only one digit that is '0'. I want it to return even 0 in two digits i;e '00'
How is that possible ?
Thanks a lot
Calculation upto a specifed number of digits
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Calculation upto a specifed number of digits
I think the function is number_format(), but you can also use sprintf('%02u', $number) or several other similar functions.
(#10850)
Re: Calculation upto a specifed number of digits
thanks a lot printf('%02u', $number) did the trick 