![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jun 2006
Location: In a box
Posts: 27
Rep Power: 0
![]() |
Zero padding
How can I add zero pad a number based on a variable length so that the length of the number is always the same?
Example: 00004 00023 34243 Always has a length of 5 with zeros added in when necessary Edit: nm i found out how using seq -w anyways, i have another question about %04d . Instead of using 4 for the digits, how could I make 4 be a variable instead? Would %0$(length)d work instead?
__________________
~ Silicon Enhanced Pudding "It's magically delicious" Last edited by Silicon_Pudding; Feb 17th, 2007 at 12:25 PM. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS Div Question | brokenhope | HTML / XHTML / CSS | 8 | Dec 21st, 2006 7:38 AM |
| A gap even though margin and padding are specified to zero. | java_roshan | HTML / XHTML / CSS | 5 | Aug 17th, 2006 1:05 AM |
| How can I get around Seg Faults | metsfan | C | 19 | Apr 24th, 2006 10:07 AM |
| Let's get this over and done with, once and for all [CSS enthusiasts this way] | megamind5005 | HTML / XHTML / CSS | 16 | Nov 10th, 2005 3:03 PM |
| MS CryptoAPI frustration - Cryptography | SugarDaddy | C++ | 1 | Jul 6th, 2005 3:05 AM |