How do I add padding to a declared variable? For example, I have DECLARE v_ counter INT; I want the counter value to have 5 spaces of padding

DECLARE v_counter INT;

SELECT '002' col1, case when c.level3 = 'NA' then '00001' else ' ' end col2, rpad('NEXT',8,' ')col3, '00001'col4, v_counter, rpad('',4,' ')col6, rpad(c.level1,5,' ')col7, rpad(i.apglno,10,' ')col8, rpad('',10,' ')col9, rpad(c.level4,10,' ')col10, rpad('',159,' ')col11, rpad(to_char(pbh.totalexcltaxes,'999999.999'),28,' ')col12, rpad('',272,' ')col13 FROM invoice i INNER JOIN bills b ON i.invoiceId = b.invoiceId INNER JOIN paidBillsHistory pbh ON b.billId = pbh.billId INNER JOIN costCenter c ON pbh.costCenterId = c.costCenterId WHERE b.invoiceId = theInvoices.invoiceId
) LOOP v_billline := '';
v_billline := CONCAT(theBills.col1,theBills.col2,theBills.col3,theBills.col4,v_counter,theBills.col6,theBills.col7,theBills.col8,theBills.col9,theBills.col10,theBills.col11,theBills.col12,theBills.col13);
RAISE NOTICE '%',v_billline; v_counter:=v_counter+1;

I want the counter output to have right padding of 5. How do I do that??

rpad(v_counter,5,' '), but I can't do an int with int.

So my expected result is if the counter = 2 and there is padding 5 2 NEXT