Kalle_76 Posted February 28, 2006 Report Share Posted February 28, 2006 Hi All! I have number that I want to convert to a string. The number can be anything between 0 and 9999. I what the string to always have 4 characters. For example the number 34 should be 0034 after conversion, 560 should be 0560, 6734 should be 6734. I know I can use sting functions to seen how many characters there are and then add zeros in front, but my guess is there is a simpler way to do this. Any ideas? Best regards, Kalle Quote Link to comment
crelf Posted February 28, 2006 Report Share Posted February 28, 2006 Use the "Format into String" primative (it's under the "string" sub-palette of the functions palette), and set your "format string" to %04d - the % is the format sepcifier, the 04 means use a minimum field width of 4 characters, and the d tells the function to format is as an integer. Quote Link to comment
djolivet Posted February 28, 2006 Report Share Posted February 28, 2006 here you go Quote Link to comment
Kalle_76 Posted March 1, 2006 Author Report Share Posted March 1, 2006 Thanks All! Your suggestions were just what I was looking for. / Kalle Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.