I have a simple question but i cannot find the answer. I have an array of integers between 1 to 999. I need the left pading of 3 so that every element is composed of 3 digits.E.g. [ 001, 002,…090…, 900]. But I would strongly prefer them to be Integers, LPAD() outputs strings.
I don’t think that’s possible since 3 == 003. If you have the bitstring for an integer 00000011 is that 3 or 03 or 003…?
Of course, there are ways around that, using a string, making a custom type with the number of leading zeros in it, storing the digits in an array (the digits-function) etc. But none of these are integers.
Maybe we can help you find a good solution if you tell us a little more about why you want it exactly this way; probably there is a good alternative.
Sorry, now I think I was confused by the question. I would agree with @giordano the only solution is to do this wherever the output is happening. You don’t want to just make all integers display that way by default, trust me.