Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3989482
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:22:44+00:00 2026-05-20T06:22:44+00:00

I have an h:inputText control where I can type in numbers up to 7

  • 0

I have an h:inputText control where I can type in numbers up to 7 digits and it will convert them to a decimal representation (ie. type in “9999999” and it will render “9999999.0”). However, when I type in any number with 7 digits or more, it will convert it to scientific notation (ie. type in “10000000” and it will render it as “1.0E7”).

As a business requirement, I must display it in decimal representation and not scientific notation. Does anyone have a way to do this?

<h:inputText id="tableQuantityId" 
        value="#{fee.tableQuantity}" 
        disabled="#{!fee.selected}" 
        rendered="#{editable}" 
        validator="#{facesValidator.validateQuantity}">
    <a4j:support event="onchange" reRender="messages, feePart" ajaxSingle="true"/>
</h:inputText>

Edit: After some further investigation, it seems that it’s getting it’s current format from the type “double”. (In other words, you can assign “10000000” to a double and print it and it will show it back to you in scientific notation).

So I went into my getTableQuantity() method and changed it from:

(double version)

public double getTableQuantity() {
    return tableQuantity;
}

(to String representation):

public String getTableQuantityFormatted() {

    double d = tableQuantity;
    NumberFormat formatter = new DecimalFormat("###.#####");

    String f = formatter.format(d);
    return f;
}

and I changed “value=”#{fee.tableQuantity}” to value=”#{fee.tableQuantityFormatted}” in my xhtml

But now I get the following error on the xhtml page:

The quantity value 10000000 is
incorrect.
/page/feeContent.xhtml
@70,58
value=”#{fee.tableQuantityFormatted}”:
Property ‘tableQuantityFormatted’ not
writable on type java.lang.String

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:22:45+00:00Added an answer on May 20, 2026 at 6:22 am
    <h:inputText 
    id="xy"
    value="10000000">
      <f:convertNumber maxIntegerDigits="10" maxFractionDigits="1" pattern="#########0.0"/>
    </h:inputText>
    

    The tag f belongs to:

    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    

    in my case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have such code: <h:inputText id=input value=#{bean.input}> <f:convertNumber /> <rich:ajaxValidator event=onblur /> </h:inputText> I
I have JSF code like: <h:inputText id=from value=#{fromToMBean.fromName}/> I would like to get this
I have this input text: <html><head><meta http-equiv=content-type content=text/html; charset=utf-8></head><body><table cellspacing=0 cellpadding=0 border=0 align=center width=603>
I have two input text boxes which are decimal. The sum of the two
If have an admin area where users can select a category name and an
I have used c:foreach to iterate and display my inputtext where each inputtext has
I have a custom validator method that will check an inputted zip code against
I have a custom model class which contains a decimal member and a view
I have an h:inputText and a rich:fileUpload. I'd like the inputText to, when click,
I have a screen with 2 JSF Input Components : inputText and inputText with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.