luki180 luki180 - 1 year ago 131
PHP Question

Formatting Integer Value Smarty

I am new in php and smarty formatting. I need to format an integer to take 5 places, for example to display 1 as 00001, 21 as 00021 and so on.

I tried string_format but instead of 00001 i was getting " 1". Can anybody help me?

Answer Source

string_format in Smarty uses sprintf

So your code should look like this:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download