I have a field in Crystal Reports that should be 5 digits long but if the first numbers are zero, it drops them. How do I add leading zeros to display as 00614 instead of 614?
But my field is not necessarily only 3 characters all the time sometimes it is 5 (which would not require the zeros) but sometimes it is 4, 2 and 1. How would I apply it for each different scenario?
not sure where i picked up the habit of throwing a # in. Im pretty sure totext({field},"00000") works as well
explanation from help file:
Represents numerical digits or zeros (0).
When the original number is converted, 0 characters are ignored unless the number of 0 characters in the format string extends beyond the number of significant digits in the original value. Then, for every additional 0 that appears, a zero is added to the string.
_____________________________________ Crystal Reports 2008 and XI
Intersystems Cache 2012 ODBC connection
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.