3 Replies Latest reply: Aug 30, 2013 3:06 AM by kdario RSS

    Not able to convert String to Number using <f:convertNumber pattern="#0.000" />

    user13630962

      JDevloper/ADF Version : 11.1.1.6.0

       

      Session Scoped Managed Bean :

      package com;

       

      public class TestBean {

          private String val;

          private float valFloat;

       

          public String getVal() {

              return "12345";

          }

       

          public float getValFloat() {

              return 12345;

          }

      }

       

      jspx file  :

       

      <af:inputText value="#{TestBean.val}">
      <f:convertNumber pattern="#0.000"/>

      </af:inputText>

      <af:inputText value="#{TestBean.valFloat}" id="it1">
      <f:convertNumber pattern="#0.000"/>
      </af:inputText>

       

       

      Output :

      For String variable it does not convert and It gives : 12345


      For Float variable it converts and It gives : 12345.000



      When I use static value in inputtext, It works

      e.g.


       

      <af:inputText value="12345}">
      <f:convertNumber pattern="#0.000"/>
      </af:inputText>



      Can anybody help me out ?


      Regards,

      Niraj