Purpose of Digit is to take a number and place leading zeros before it if needed to bring the length of the number up to places. Warning: Will not work properly with negative numbers Inputs can be either numeric or character Inputs must be integer values (e.g., "1" or 1 are okay, 1.5 is not.) Places variable should be at least 1 Output is in character format (to preserve leading 0's!) I have a similar function for Python, but it is implemented differently.
1 | Digit(number, places)
|
number |
a number to put into the function |
places |
The number of places to make the number. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.