Jump to content

Specifying Amount of Digits


funstein

Recommended Posts

Hello there,

 

I have a script that has two variables called oc_id and oc_pos. These variables, oc_pos and oc_id, are summoned from a database based on user input. Sometimes it is 120, sometimes 50, sometimes 5. So the number of digits varies.

 

Now I need to convert these into an identifier string for some purpose. But I want them to be 3 digits always, for example, 120, 050, 005. How is that possible?

Link to comment
https://forums.phpfreaks.com/topic/244829-specifying-amount-of-digits/
Share on other sites

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.