title: number format to char in oracle while creating a view
body: <p>I have the below view:</p>
  
  <pre><code>    CREATE OR REPLACE  VIEW viewA ("col1", "col2") AS 
    SELECT DISTINCT CAST("col1" AS CHAR(1)),
   CAST(to_char("col2",'00.0000') AS char(7))
    FROM tableA
  </code></pre>
  
  <p>the col2 has data like 22.33 or 2.3 or 0.2345 or 2 but, four digits in dec and 2 digits in number.
  It has to be written into a file with fixed length of 7 digits including decimal. Hence i wrote col2, '00.0000', but the number format'23.234' is written into col2 as 23.234 without any trailing zero. </p>