[Omaha.pm] How do I turn 17.1 into "017.100" ?

Jay Hannah jhannah at omnihotels.com
Fri Dec 9 11:51:45 PST 2005


Given any number I want a string where (1) the whole string is 7
characters long, (2) there are three digits after the decimal point, and
(3) the number is zero padded in front.  

e.g.: 17.1 becomes "017.100".  

Is there a printf FORMAT for this? Or is this a 4 liner?

Thanks,

j



More information about the Omaha-pm mailing list