title: Oracle pl/sql query add spaces to number so that it right aligns
body: <p>I have a query which returns a  price  which is a number(16,2) data type. </p>
  
  <p>So  the query SELECT  PRICE FROM PRODUCT ; </p>
  
  <p>it should return</p>
  
  <pre><code>   10.00
   1234.00     --&gt; values are right aligned; space needs to be added to 10.00 
                   to align it with 1234.00
  </code></pre>
  
  <p>How many spaces to align is dynamic we know the datatype length is (14,2)  , so  I want to convert the number to char and add spaces to left of the number.</p>
  
  <pre><code>  SELECT LPAD(p.price , (17 - LENGTH(TO_CHAR(p.price))),' ')  FROM Product.
  </code></pre>
  
  <p>I tried the above query but it is not giving me the right result.</p>
  
  <p>I just wanted to know what is wrong with it </p>