JSF number converter, 4.0E12

How is right way to use standart converter for example
4000000000000 show as 4.0E12, I want see only 40000000000000000 but now 4.0E12!
  <h:inputText value ="#{bean.cost}" required="true">
                   <f:convertNumber type="number" maxIntegerDigits="3"/>
                    <f:converter converterId="javax.faces.Double"/>
                    <f:validateDoubleRange minimum="5"/>
                  </h:inputText>cost is double

Use the pattern attribute of the <f:convertNumber> converter.

Similar Messages

  • Jsf newbie :: converter and navigation issues

    Hi,
    Iam facing a problem in my first jsf application.
    Iam using jsf 1.1 and tomcat 5.5.7
    I have a UserBean with a single attribute userName (which has public getter and setter methods).
    * I have an index.jsp that redirects to login.faces.
    * I have the appropriate servlet url-mapping in my web.xml that maps *.faces to the FacesServlet
    Here's the code for login.jsp
    <f:view>
       <h:form>
             <h3>Please enter your name </h3>
         <table>
          <tr>
              <td>Name:</td>
            <td><h:inputText id = "name" value="#{user.userName}"/></td>
         </tr>               
         </table>
         <p><h:commandButton value="Login" action="welcome"/>
         </p>
         </h:form>
       </body>
    </f:view>Next I have a welcome.jsp which simply outputs Hello <userName>
    <f:view>
      <h:form>
         <h:outputText value="#{user.userName}"></h:outputText>
      </h:form>
    </f:view>And this is my faces-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
         <managed-bean>
              <managed-bean-name>user</managed-bean-name>
              <managed-bean-class>com.myjsf.UserBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/index.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>welcome</from-outcome>
                   <to-view-id>/welcome.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>Now when I start my application , the index page redirects me to login.faces. I believe the FacesServlet intercepts this call, strips of .faces and forwards to login.jsp. Login.jsp is displayed correctly, so far so good. However from here on, I have all kinds of problems
    1. Should the <from-view-id> be /index.jsp (my actual url) or /login.jsp (the url to which index.jsp forwards me to). Actually both seem to work (or not work depending on how you look at it :( )
    2. Anyways whatever I set it to, the login.jsp is displayed correctly. The action attribute of the commandButton tag is set to 'welcome' which matches with the <from-outcome> value in navigation rule in faces-config.xml and I would have expected the welcome.jsp to load on form submit.
    But the form just reloads itself on clicking submit.
    I googled around and discovered that this may be due to validation errors or conversion errors and adding <h:messages/> would indicate the error source. AQccordingly I added it and got this o/p
    " "name": " Conversion Error setting value 'Duke' for 'null Converter'. To cut a long agony story short, I found that I have to define a converter for some data types for validation and/or display. But all I have is a String property. Doesnt jsf provide a default Converter ?
    3. I couldnt get my app to work when I put my jsps in a folder and access them as /<foldername>/jsp in my faces-config.xml. Isnt this possible ? Should all jsps be under the root folder ?
    Will be thankful for any help.
    cheers,
    ram.
    2. Whenever I click on

    Thanks for the reference , I shall definitely go through it.
    My immediate concern is to get the first program working.
    Here is my source code for the bean.
    package com.myjsf;
    import java.io.Serializable;
    public class UserBean implements Serializable {
        private String userName;  
        public String getUserName() {
            return userName;
        public void setName(String userName) {
            this.userName = userName;
    }Here's my login.jsp which comes up fine
    <f:view>
       <h:form>
         <h:messages/>
             <h3>Please enter your name.</h3>               
                 Name: <h:inputText id = "userName" value="#{user.userName}"/><br>
                  <h:commandButton value="Login" action="welcome"/>
         </h:form>
      </f:view>Here's my faces-config.xml
    <faces-config>
         <managed-bean>
              <managed-bean-name>user</managed-bean-name>
              <managed-bean-class>com.myjsf.UserBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>welcome</from-outcome>
                   <to-view-id>/welcome.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>     And this is the error that I get
    "userName": Conversion error occurred. The page gets displayed again. One thing I noticed was that in the html - view source the action attribute of the form tag is set to /myjsf/faces/login.jsp. Shouldnt it be welcome.jsp rather ?
    Iam at my wits end. I have decided to write a Converter which may solve my problem, but is it required ?
    Please help.
    Thanks,
    Ram.

  • Exponential to fixed point number convert

    Hello All,
    I am getting below result for the double value.
    double d = 7777777.77;
    System.out.println(d); O/P >> 7777777.77
    double d1 = 88888888.88;
    System.out.println(d1); O/P >> 8.888888888E7
    Actually I dont want the value to be in Exponential format. I found that when the decimal is before 7 digits , am getting correct value (without exponential format). But when decimal is after 7 digits then value gets in exponential format.
    If this is the default behaviour which we cant change then how to convert the exponential format number to fixed point number.
    Thanks
    Prasad.

    Don't use the default conversion on double numbers except for debugging. Convert floating point numbers to String format either with String.format, or with a DecimalFormat object. Either gives you proper control over the format.

  • Fract String to Number converts "700,5" to 700,49999999

    I found that for some numbers the Fract String to Number vi creates a small rounding error. As an example “700,5” converts to 700,49999999. (Se attached image and vi). Is there a way to fix this?
    To see this error you have to adjust the number of digits to display in the Display format property tab. Or you can try using the round to nearest vi which will round to 700 and not 701. (This was how I found the error 
    I’m using Labview 2009.
    Terje
    Message Edited by Terje on 02-08-2010 05:00 AM
    Message Edited by Terje on 02-08-2010 05:01 AM
    Message Edited by Terje on 02-08-2010 05:06 AM
    Solved!
    Go to Solution.
    Attachments:
    rounding error.vi ‏6 KB

    Gerd,
    i just searched in the web a little bit in order to shed some light on the issue. Sadly, i found no real "solution", but something interesting:
    Due to Wikipedia (See in chapter "Character Representation"), the rounding for floating point numbers is correct with 17 decimal digits for binary64 values (which LV-doubles are).
    I previously found out, that the change from 770.5 to 700.4999 is done if the number of significant bits in the display option is set to something higher than 17 (so 18 or above).
    I find this is a fascinating coincidence......
    Norbert
    Message Edited by Norbert B on 02-08-2010 07:52 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Decimal number converted into coma "," separated number --- how to resolve

    Dear All
    In our E-Business 11i (11.5.9), we are facing strange problem since few days, when ever user enter any number e.g. 145.098, it is converted as 145,098. It is weird problem, any resolutions for this............
    cheers
    Mehmood

    Dear All
    Thanks for all the inputs, we generated the SR as well, and we got the following response, we applied all that, and now we are not facing any issue.
    ==============
    1. Check Profile Option "ICX: Numeric characters" if it is NULL, 10,000.00 or 10.000,00
    Do not set the Profile Option ICX: Numeric Characters to 10.000,00 at the site lev
    el.
    Set the System Profile Option: ICX: Numeric Characters, at the site level to 10,000.00 and if any
    user needs the different format of 10.000,00 then change it through the General Preferences link
    which will set the profile option at user level to 10.000,00.
    2. Confirm in File "Init.ora". If Parameter "NLS_NUMERIC_CHARACTERS" is equals value:
    NLS_NUMERIC_CHARACTERS = ",."
    3. Set the FND profile CURRENCY:THOUSAND_SEPARATOR to TRUE
    4. Set the NLS_NUMERIC_CHARACTERS=".," in the $APPL_TOP/<SID>.env
    5. Bounce the Apache Server for any setup changes to take effect including profile options.
    ============
    cheers
    Mehmood
    Message was edited by:
    murphy16

  • Number converted to a decimal form

    Hi Folks,
    I've been using the abs/formatnumber(#) function and the number gets converted to this form:
    Source: 4500016288
    Target: 4.5000161E9
    BELNR -
    > abs -
    > D_324
    It is really strange though, since I have tried converting the EDI-XML instance in Seeburger and the data in the target field also shows the right format.  But when the trading partner processes the EDI, they are getting the 4.5000161E9 format.
    Any advise please?
    Thanks!
    Regards,
    Lex

    > I've been using the abs/formatnumber(#) function and the number gets converted to this form:
    >
    > Source: 4500016288
    > Target: 4.5000161E9
    >
    > BELNR -
    > abs -
    > D_324
    >
    Hi,
    You didn't mentioned what exactly you what to do with your source value. Do you want to add leading zeros or remove the leading zeros or want to put decimal point because all are possible with FormatNum. 
    If you let me know your requirement then I can suggest you exact & suitable solution for your problem. Give me some example.
    Regards,
    Sarvesh

  • Lost Digits of big Number - convert Double into Hex

    My Number is 24563383270390080
    if i debug the Variable it has got a value of 2.45633832703901e+016, so i lost a little bit of the value.
    if i bring ist into a sting, i can see the complete value "24563383270390080"
    i have to convert the number in to a Hex-Value, the Reuslt should be "$57444456503941" an can be written into a string.
    my problem is to bring the original value into a string of hex, because diadem round the last digits of my number
    i tryed several convertions, but the the probmel of lost digits is still there....
    maybe you´ve got an idea
    dim Number, NumberString, HexTest1, HexTest2, HexTarget
    Number = 24563383270390080  '17 Digits
    HexTarget = "$57444456503941"
    NumberString = Str(Number, "d")
    HexTest1  = Str((Data.Root.ChannelGroups("Neu").Channels("Vin_Data").Values(1)), "$")
    HexTest2  = Str(Val(Number), "$")
    '---> Result
    ''--> Number       = 2.45633832703901e+016
    '--> NumberString = "24563383270390080"
    '--> HexTarget  = "$57444456503941"  
    '--> HextTest1  =  $57444456503940  !!!!! Last Postion !!!!
    '--> HextTest2  =  $57444456503940

    You are a little bit out of luck with your example because
    dim number : Number = 24563383270390080 '17 Digits
    dim txt
    txt = txt & Str(Number, "d") & " ref: 24563383270390080" & VBCRLF
    txt = txt & Str(Number, "$") & " ref: $57444456503940" & VBCRLF
    MsgBox txt
     0 at the end is correct. (At least the MS calculator says so.) But this is by incident because of the number you picked.
    VBS only supports 64 bit double values. 64 bit doubles have a mantissa of 52 bits.
    24563383270390080
    becomes
    1010111010001000100010001010110010100000011100101000000
    which has 55 bit in use. Because your last bits aren't in use the number you picked can be represented by a double without loosing precission.
    24563383270390081
    would show the behavior you described because it is using 55bit range. The 1 is just cut when converted to double.
    But I have no solution for this because it will not work with VBS.

  • PO Number converted PR is Not updated in SC

    Hello friends,
    We are using classic scenario and we are creating "Shop with Limit". The follow-on document is Purchase Req. that is updated in the Shopping Cart. However, when the Purchase Req is converted in R/3 as a PO it is not updated in Shopping Cart.
    However, if I create Free Text --> PR to PO then the PR and PO both are updated in Shopping Cart. Can someone throw some light on this issue please.
    srinij

    Hello Srinij,
    PO should get updated for limits as well.
    Run the BBP_GET_STATUS_2 program for your shopping cart & check if the PO gets updated. See the related documents in BPP_PD for your shopping cart.
    Please let us know your system details to help you better.
    Hope this helps.
    Ashutosh

  • Character to number convertion --- APEX Checkbox

    Hi ,
    I have table column like category here i stored the value as 1:2:3:4 using APEX checkbox.
    Now i want to change as 1,2,3,4
    i used replace function but its giving the char value only i want to change it as a number.
    Can anyone help me out this problem.
    Thanks in advance....
    cheers,
    Shan..

    1,2,3 is not a number - it is three numbers so you need an array or a table to store that.
    Go to SQL Workshop and create this table:
    CREATE TABLE emp_numbers (empno NUMBER);after that run this PL/SQL block and enter 1:2:3:4 for your :p1_emps
    DECLARE
       l_vc_arr2   htmldb_application_global.vc_arr2;
    BEGIN
       l_vc_arr2 := HTMLDB_UTIL.string_to_table (:p1_emps);
       FOR i IN 1 .. l_vc_arr2.COUNT
       LOOP
          INSERT INTO emp_numbers
                      (empno
               VALUES (l_vc_arr2 (i)
       END LOOP;
    END;See what you get inserted into your table.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • JSF/MyFaces Converter getAsObject() method doesnt get called

    I have two h:selectManyList boxes and a custom converter
    On form load, right box gets populated with some values and has converter attached to it , the getAsString() method is invoked
    When i hit submit button the page it goes directly to the action method without invoking converter
    Wondering why its bypassing Validation/Conversion phase and directly going to Invoke Application phase
    I verified that i dont have immediate="true" attribute attach to h:selectManyList component and their is no any a4j events i.e. ajax4jsf also . So what exactly is causing the problem
    I also set immediate="false" for all the components on page
    I am having this problem for couple of days i will appreciate any help.

    Thanks for quick response.
    Here are the answers.
    Is a value being selected by the client?
    Not sure what you mean. As i come from search screen, when the form loads the values are automatically populated into right h:selectManyListBox
    Is the component's value attribute bound to a backing bean property?
    Yes the component's value attribute bound to a backing bean property. In addition to h:selectmanyList component i am HtmlInputHidden Field and Javascript. On Submit the javascript will submit the inputHidden field values to the backing bean. Please note both h:selectmanyList component and inputHidden field component are bound to same backing bean property. Here is the snippet
    <h:selectManyListbox id="fqdnPolicies"
                             value="#{updateDeviceBean.fqdnPoliciesSelected}"
                             converter="#{policyConverter}">
                             <f:selectItems value="#{updateDeviceBean.fqdnPolicies}" />
                        </h:selectManyListbox>
                        <h:inputHidden id="selectedFqdnPolicies"
                             value="#{updateDeviceBean.fqdnPoliciesSelected}"
                             converter="#{fqdnPoliciesConverter}" />
    <h:commandButton  value="Update"  action="#{updateDeviceBean.updateDevice}" styleClass="button" onclick="return shuttle.setSelected();" />What is the value of that property?
    The value as seen from FacesContext.getRequestMap is String i.e. "2, 1,7" and i have custom converter which converts String to List and parsing etc. Unfortunately the getAsObject() which does this doesn't get invoked
    What is the result of getValue() on the component?
    Null

  • Converting TimeZone & Currency with i18n in MyFaces

    Hi,
    I am trying to write a simple JSF app with i18n, need to support English, Russian and Spanish.
    I have noticed that TimeZone time, CurrencyCode and CurrencySymbol (which I get from resource bundles)
    remain the same when you change locale (DateTime and Number converter formatting does change correctly).
    Is that a bug ?
    I am using MyFaces 1.1.5 Happens in all browsers.
    Thank you in advance,
    Oleg.

    Why would you think that time zone would (or should) change when you change your locale? I think Russia extends over something like 8 different time zones - which one would you pick? Not to mention that you might very well be using an application in a certain language and locale but be located in a completely different time zone (you might be traveling, or you might be a native speaker of a certain language living permanently in another country, etc.).
    Similarly for currency: there is not necessarily a one-to-one link between locale and currency. Many online businesses offer payment in just one or two currencies, but offer a user interface in many languages. And you would need to perform currency conversion anyway, if the currency was tied to the UI/locale - let's say a user uses German, and sees currency amounts in Euros. That same user then switches to en_US as the locale. You wouldn't want to just automatically switch the currency symbol to be the one for US dollar, without converting the amount shown. So you need to/want to perform that as a very explicit process (converting both amounts AND currency symbol).

  • EA Faces & BigDecimal Converter

    Does the standard number converter work for BigDecimals that are set as a currency type? I wasn't able to get this to work and had to write a converter for the conversion. I thought I had read the JSF spec was supposed to support the conversion of BigDecimals.

    Hi Brian,
    The Sun's api provides BigDecimal converter. So you don't have to write one. javax.faces.convert.BigDecimalConverter is available at the api side and is registered with id javax.faces.BigDecimal.
    You should be able to use <f:converter converterId="converterId"/>. Hence it can be used with any UIComponent and will work with ADF Faces components.
    Thanks,
    Vijay Venkataraman

  • DID YOU KNOW ?? - Number Converters?

    Hi All,
    DID YOU KNOW??
    That the Creator IDE provides a set of converters that you can use to convert component data. If your input field is for numbers, then you most likely need a converter. Converters are also good for formatting dates, times, and currency values. The standard converters, which you can use are located in the Converters section of the Components Palette.
    The Number Converter
    Is a type of converter that Converts between java.lang.String values in your component properties and data types of java.lang.Number. The conversion usually applies to the property a component uses to display values and to pick up values entered by users. For example, the Text Field component uses the text property for this purpose.
    The Number Converter returns a Long if possible (within the range [Long.MIN_VALUE, Long.MAX_VALUE] and with no decimals), otherwise a Double. If you need the converter to return a numerical type other than Long or Double, or you need to narrow the choice to a specific type. The other lists of converters to choose from include Big Decimal Converter, Integer Converter, Long Converter, Float Converter, Long Converter, Short Converter and Double Converter.
    When you bind a component, the IDE normally identifies the data type for you and sets the appropriate converter when you establish a binding to the value property. However, you can also add a converter manually by setting the component's converter property.
    We would like to know the following from you :-
    1) Why and How are you using Converters in applications you are building?
    2) Did you face any challenges while using them?
    3) Did you find any cool ways of using these or build any cool custom converters?
    4) Any feedback you might want to share about converters to make it easier in using them.
    Thanks for all your inputs and for joining in the discussion.
    (Note :- This is the continuation of the Threadinar Series - see index at
    http://forum.java.sun.com/thread.jspa?threadID=5103424)
    K

    I'm having problems converting from text input with a NumberConvertor back to text. I'm trying to take a pay amount, annualize it (x * 24), and convert it back to text for a database query. I got the following to work, but is there a better way?
    Input field is "grossPay", output is "apay".
    public String button1_action() {
    Number n = (Number) grossPay.getValue();
    float f = n.floatValue() * 24;
    apay.setText("" + f);
    return null;
    }

  • Internal table data 1E2 automatically convert to scientific format

    Dear all,
    I have been searched for solution moths from the forums and tried all possible methods, but still no way to solve my above problem.  I found a way to solve it partially for us, but may be very helpful for others who meet similly case like mine, so I posted here.
    my problem is when I export my internal table data to Excel, the Cell data with 1E2 auto becomes 1.00E02, and 1E8 becomes 1.00E08, we need it to be 1E2 and 1E8 in excel.
    you can recreate my problem by
    1,  input 1E2 into your Microsoft Excel, then Enter, it will auto change into scientific format. which is we do not want.
    2, use any of your SAP system open any table as long as there is a Char (>3) field in that table. add some
    data entry in that field in the form "any amount (<15) of numeric 1 to 9"E"any one or two numeric 1 to 9". such as, 123E2, 1234E12 etc. then save this table's data to local file spread sheet, or use any FM to download it to a Excel file, when you open this
    file by Excel, the cell with above form will display as scientific. but
    if you put three or more numeric after the "E", such as 123E123 it will
    display correctly.
    what I have done:
    I searched in SCN for similar thread:
        Export to Excel 2007 - item number problem
        Exceding the limit of numbers in Excel at target side
        Excel download cell format problem
        Formating as Text in excel through SAP
        Converting of amount field into excel file through GUI DOWNLOAD
        Data downloaded to excel gets converted to exponential format.
        Problem with Excel download   and scientific number
        Re: Issue in displaying numbers in Excel?
        CSV Flat File Data Problem (Number converting to Scientific Notation)
    Tested accordingly, But none of these works in our case. because our
    ultimate receiver of email attachment will be external third party, we cannot ask
    them to change anything in their Excel.
    Search Microsoft help about Excel, http://support.microsoft.com/kb/214233,
    and it says this "Automatic Number Formatting" is a normal behaviour of excel.
    no way to turn it off, the "work-around" way that Microsoft provides is not suitable for our
    case.
    We test CL_iXML recently arrording to weblog http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment
    it successful controled the format. so this could be a solution for others whose internal table size is small. but our 2MB internal table bocome 6MB when converted to xml file attachment, which cannot be received by our end user's mail box. too big.
    So please advise your ideas.
    Many thanks in advance!
    Peter Ding
    Thank you very much for your time!

    Hi,
    You can achieve this by describing the spreadsheet in XML with the help of the DOM classes.
    The later releases of Excel can read and save spreadsheets as XML, providing your release supports this you can achieve it.
    Check out the following Wiki
    [Excel - XML|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/exporting%2bdata%2bto%2bexcel%2b-%2bxml%2bto%2bthe%2brescue]
    Regards,
    Darren

  • Se16 down load into excel sheet problem with PO number

    Dear All,
    While I download vbak table data using se16 from table VBAK ( using System > List> save --> local File --> Spreadsheet ), I get the PO number converted as error like at it's end, the last digit is becoming zero when po number is of 16 digits.  means only the last digit is converted to 0.
      For example : se16 -> vbak table -> the po numbers
    1238643210249039, when I down load in the excel sheet it is appearing as 1238643210249030
    (I means the last digit of the PO number is downloaded with error, it is always a u201C0u201D.
    if the PO number is of less than 16 digits... the above problem is not there )
    How to correct the error ? How to tell solution to functional consultant ? Can you please suggest me
    Do we need to apply any OSS message ?
    Thanks in ADVANCE.
    Edited by: sam kumar on Dec 8, 2008 5:40 PM

    Hi,
    Just found that 'Numbers in Microsoft Excel can never have more than 15 significant digits'.
    check this link from Microsoft: [http://support.microsoft.com/kb/158071|http://support.microsoft.com/kb/158071]
    check this  [http://office.microsoft.com/en-us/excel/HA102748231033.aspx|http://office.microsoft.com/en-us/excel/HA102748231033.aspx]
    [http://office.microsoft.com/en-us/excel/HA102748231033.aspx#5|http://office.microsoft.com/en-us/excel/HA102748231033.aspx#5]
    What i can suggest is, put a apostrophe (') for the value of first cell content at the beginning.
    Use Format painter to apply the same for all values in that column.
    Regards
    Raj
    Edited by: Rajasekhar Dinavahi on Dec 8, 2008 10:59 PM
    Edited by: Rajasekhar Dinavahi on Dec 8, 2008 11:00 PM
    Edited by: Rajasekhar Dinavahi on Dec 8, 2008 11:05 PM

Maybe you are looking for

  • Role removal workflow

    Hi experts, I'm trying to understand what's needed to remove user roles using workflow.  My understanding was that I needed to use the same workflow for user provisioning and just treat the removal as a user change (SAP_GRAC_ACCESS_REQUEST) but when

  • How good is the iphone or 3gs model

    I just want to know your idea on the iphone if i should buy it or not. i would like to get the 16g 3gs thanks

  • Poor quality of background movie

    Can someone please help. I created a 30 second clip with text in After Effects and rendered it out as a QT file at the highest resolution. I then brought that into DVDSP and placed it as a background movie for my menu. The quality of the movie is jus

  • Import procurement with dealer

    we have a scenerio wherein the material is procured from a delar but he is doing import so he cant claim the cenvat and passes on to us to claim it. But at the time of raising the PO the duties are not captured and known at GRN only so kindly advise

  • How to call Absence start date in absence Dff in SSHR.

    How to call Absence start date in absence Dff in SSHR.