8 Replies Latest reply on Apr 8, 2021 2:54 AM by Nico Heinze

    Find whole number and decimal and pad zeros.

    Arya Nymeria Active Member

      Gurus, for a given whole number or decimal I need to pad '00' to right and remaining zeros to left if the length is less than 12. For example if the number is 123 then  000000012300. Similarly for decimals if i have 999.14 then 000000099914. My approach is using an IS_NUMBER function to find if it is a number but I could only get either 0 or 1 as output. LPAD or RPAD to concatenate 0's but how to find if it is a decimal or whole number or negative number? Is there any other function that makes it easy? Open for suggestions.


      INPUT                         OUTPUT

      123                     000000012300

      999.14                000000099914

      -999.1                000000099910-