|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Number Formatting
I realize there's a function called number_format() but from how I interpret the documentation, it doesn't do what I want it to.
I'm looking for a way to display more digits. For example, instead of 6, display 00006 ... number_format() seems to deal with decimal and precision (and slight currency) |
|
#2
|
|||
|
|||
|
PHP Code:
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#4
|
|||
|
|||
|
alternative??
Alternatively, you could write:
PHP Code:
This would return '000006' and also works with 2 or more digits (e.g. '212' -> '000212') without changing your code or make calculations on the number of digits. You could also use: PHP Code:
This produces the output '000006' straight away. Regards, |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Number Formatting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|