Format  a number using JSTL

<fmt:formatNumber value="${Form1.map.amount}" type="currency" var="amt"/>
this is returning $10,000,00.00 value.
Want the value 10,000,00.00 i.e without dollar sign. The length of the number might vary.
Similarly,
<fmt:formatNumber value="${Form1.map.interestrate}" type="percent" minFractionDigits="0" maxFractionDigits="2" var="interestrt"/>
is returning 2.45% value.
want the value 2.45 i.e without %.
would like to display the values in the text fields, as I have $ and % symbols before and after the textfield want the formatted value alone.
How can this be done?
Thanks.

Maybe if you specify currencySymbol="" in your tag?
It adds the $ and % signs because you tell it is is currency and percent.
Leave out the "type" argument, and it won't put those symbols there.
You may have to specify decimal places etc.

Similar Messages

  • How to format a calculated field using JSTL

    Hi,
    I have one field as following:
    <input type="text" class="fixedInput" name="grossRevenue<%=i%>" value="<%=((LineOfBusinessMetrics)lineOfBusinessMetricsList.get(i)).getGrossRevenue().setScale(2,BigDecimal.ROUND_HALF_UP)%>" size="16" onfocus="this.blur()" /></td>
    In the above line of code, I have one list called lineOfBusinessMetricsList. From this list, I am fetching the object of LineOfBusinessMetrics, from this object, I am fetching the value of Gross Revenue and casting it to LineOfBusinessMetrics.
    Now I am trying to format the Gross Revenue using JSTL tag "fmt" as following:
    <td class="grey3"><input type="text" class="fixedInput" name="<c:out value='grossRevenue${i}'/>" value="<fmt:formatNumber type="number" value='${lineOfBusinessMetricsList.grossRevenue}' minFractionDigits="2" maxFractionDigits="2" />" size="16" onfocus="this.blur()" /></td>
    The above modified code wth JSTL tag fmt is not working correctly.
    Can anyone help me to get this code work.
    Thanks in Advance,
    Vijay

    You must submit the page to do it with PL/SQL. If you do not want to submit the page, you must do it with JavaScript.
    Thanks,
    Tyler

  • Number Formatting in Excel using HSSF POI

    Hi,
    I am downloading some data into the Excel file using hssf poi and I do my number formatting(either rounded,unrounded or general etc.) in java. The problem is that after the Excel file is created, the values in it behave like text though it shows the format as number. I am not able to plot any graphs or do any mathematical calculations using it. I need to convert it using "=VALUE(data)" before I do so.Is there anyway I can rectify this in the API itself?
    Your suggestions will be very helpful.
    Thanks.

    http://jakarta.apache.org/poi/hssf/quick-guide.html#CellTypes ?
    Otherwise, Apache POI has a mailing list...

  • Exception When trying to Format XML using JSTL

    Hi all
    I m trying to display content of XML in a .jsp page using JSTL ,
    When i try to dispaly the content it is thowing an exception :
    org/saxpath/SAXPathException
    Can any one please help ....
    i m using jstl1.0.6.jar and standard-1.0.6.jar
    Code Snppet Used:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <c:set var="someXML">
    <name>Sri</name>
    </c:set>
    <x:parse var="parsedDocument" xml="${someXML}" />
    <x:out select="$parsedDocument/name" />
    Thanks in Advance

    Thank for reply
    I had even tried with this code:
    <c:set var="someXML">
         <person>
              <name>Joe</name>
              <age>30</age>
         </person>
    </c:set>
    <x:parse varDom="parsedDocument" xml="${someXML}" />
         <x:set var="name" select="$parsedDocument/person/name" />
         <c:out value="${name}" />
    even then i m getting the same exception:
    Message: org/saxpath/SAXPathException

  • Hw can i get arabic support in oracleAS using jstl: showing '?????' symbols

    Hello All,
    I am using OracleAS for portal deployment and portlets UI constructed by using jstl.
    i have used spring portlet jstl for the jsp pages.
    when i am trying to change the language, it is showing '?????' symbols.
    I have used correct unicode. i tested in pluto portal server. when i deployed in oracleAS,
    for english not a problem. for arabic it is showing as '????'.
    i have used this code to get arabic in pluto. same code i used. i am getting error.
    <c:set target="${pageContext.response}" property="characterEncoding" value="UTF-8" />
    <fmt:setLocale value="ar" />
    <fmt:requestEncoding value="UTF-8" />
    i know it is not setting charector encoding.
    i tried some other too like:
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    and
    <%@ page pageEncoding="UTF-8" %>
    No improvement. please help me out of this.
    how can i get arabic support in oracle AS by using jstl?
    Thanks,
    Arun

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • How to Format a number to support multiple languages

    I am trying to format a number so that it shows up with the corret decimal separators and thousands separators for different regions/languages, but can't seem to.
    123456.223 is 123,456.223 (US English) and 123 456,223 in French (France)
    I don't know how many such regional settings are being used and what the decimal and thousands separators are.
    If you set the Format to 'System Default Number Format', all is well (But I have to live with 2 digits after the decimal). However, if I want to customize it by saying choosing one of the preset formats or using 'Customize'(say 3 digits after the decimal, for example), then, if I am designing the report in US English setting, the separators from that setting are used, even when the report is generated in French locale. Even if I try to put in a condition for these separators and use 'DefaultAttribute', it doesn't seem to help.
    One workaround is to format the number as a string and display the string instead (this time use ToText() function and provide the no. of decimal places needed). But I have aggregations based on this field and they don't work in with string fields.
    Could someone advise me if there is a way to solve this problem? (I'm hoping that there is some way, perhaps an easy one to overcome this problem.) It seems anytime I want to change the default setting, the current values are stored and used irrespective of the reigonal setting.
    Any help is greatly appreciated.
    Thank you,
    Raghu

    Use the default settings and then it should format according to the local PC settings.

  • Help reg what formats to be used for my new 4tb mini stack to back up my macbook and 2 external hard disks

    Hey Guys,
    I need an advice from you experts regarding the different formats to be used to format my New 4 Tb ministack from OWC. I  have a  Mid 2010 Intel macbook pro with 500gb hard disk using Mountain lion and two external hard disk from Samsung and Iomega 1Tb each. I want to format this ministack into 4 partitions each of 1Tb each.
    1) 1 Tb for time machine to back up my macbook pro.
    2) 1 Tb of  Free space to be used to store extra data using both windows and mac os.
    3) 1 Tb for Samsung back up
    4) 1 Tb for my Iomega back up
    I know that for 1st option i need to format the partition (volume) to Mac os extended (journalled). I need help for  others.For  the 1 Tb free space, can i use NTFS so that i can use it on my wifes windows laptop and use a third a party application like tuxera NTFS for use on my macbook which i am already using to use my samsung and Iomega Ext HDD.
    Also  What format is required for these  two 1 Tb volumes dedicated for external hard disk backups and  how can i back up my external hard disks to these formatted volumes. Do i need to  format them to Mac os extended (journalled) as well as i shall be using macbook pro to back up these hard disks.
    Which would be the best software to back up these Ext hdd,can i use time machine? or CCC ?
    Your help help shall be gretaly appreciated.
    Thanks in advance.

    Get Disk Warrior that will repair the problems without requiring that you reformat the drive - $99.00 on a bootable CD. Will not work on a FAT formatted drive.
    You will need to use Drag and Drop to save your files by copying them from the bad drive to a good one.
    To reprep the drive:
    Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to GUID then click on the OK button. Set the format type to Mac OS Extended (Journaled.) Click on the Partition button and wait until the process has completed.
    4. Select the volume you just created (this is the sub-entry under the drive entry) from the left side list. Click on the Erase tab in the DU main window.
    5. Set the format type to Mac OS Extended (Journaled.) Click on the Security button, check the button for Zero Data and click on OK to return to the Erase window.
    6. Click on the Erase button. The format process can take up to several hours depending upon the drive size.

  • Format a number

    Hi,
    I need some help with formating a number.
    I am having a string object of format '00000' and i want to have it formatted to '000.00'
    Is there a way i can change it to double by specifying the format?
    Let me know if there is any way i can do it using Number format or Decimal format?

    Does this String come in any other flavors? Is it to represent currency? Myself, if this were currency, I'd read it in as an int and even save it and manipulate it as an int. Then when I wanted to display it, I'd divide by 100.00 and use a either a NumberFormat.getCurrencyInstance if it's currency, or else a DecimalFormat if not.

  • How to format large number field in XML so that it appears as is in Excel

    Hi
    I need help in formating the number field so that the number displays completely in Excel.
    Ex: 12345678889453 and this appers in Excel as 1.23457E+13
    Please let me know if you have any idea on this.
    Thanks

    Hi friends,
    Thanks to all of you that you all have replied my question and given your answers.
    Thanks to all of you specially Alpana Phapale, Wallie Chang, Poonam Thorat and Raghavendra Gadhamsetty, the answers given by you is the perfect one may be in different ways and only one can be used by me. But your answers were exactly correct.
    Thanks to Asha Lund, your answers is also correct but the result as per my report should be in figures and not in words.
    Whatever it may be but for repling thanks to you too.
    Please be always with me, I am very new to Crystal Report and just learnt by my own as my Boss ordered me to do this and I have to make about 50 reports within 15 days. I think the day will start from today.
    Well friends thanks a lot again for all your effort.

  • JSP Worked Well Using Scripting Elements, But, Becomes a Null Using JSTL

    I have to bother all of you again with my JSTL problems. I am working on a JSP, which is very similar to the one that caused a lengthy discussion on this forum before. This JSP is a bit more complicated.
    Again, this JSP worked well and displayed what I expected when the page was coded using the scripting elements.
    I tried to use JSTL where possible and managed to correct all the compilation errors.
    Now, I got a simple message: 'null' in the browser without any explanation - typical problem working with JSP: very difficult to debug.
    I have tried to identify problems "one by one" and found the first encounter is where I want to set the background color for each row inside the <c:forEach ....> tag.
    I examined the code again and again, I could not see what would lead to 'null'. I need a hand again.
    <%@ taglib uri="/tags/struts-html-el" prefix="html" %>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/tiles" prefix="tiles" %>
    <%@ taglib uri="/tags/request" prefix="req" %>
    <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
    <%@ page import="org.apache.artimus.message.utility.ParamUtil" %>
    <%@ page import="org.apache.artimus.message.exceptions.AssertionException" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUser" %>
    <%@ page import="org.apache.artimus.authorization.OnlineUserImpl" %>
    <%@ page import="org.apache.artimus.filter.EnableEmotionFilter" %>
    <%@ page import="org.apache.artimus.message.ThreadBean" %>
    <%@ page import="org.apache.artimus.message.PostBean" %>
    <%@ page import="org.apache.artimus.message.AttachmentBean" %>
    <%@ page import="org.apache.artimus.MessageInboxConfig" %>
    <%@ page import="org.apache.artimus.WebSiteGlobal" %>
    <%@ page import="org.apache.artimus.SiteUtil" %>
    <c:set var="threadBean" value="${requestScope.ThreadBean}" />
    <c:set var="postRows" value="${requestScope.PostBeans}" />
    <c:set var="numberOfPosts" value="${requestScope.NumberOfPosts}" />
    <c:set var="previousTopic" value="${requestScope.PreviousTopic}" />
    <c:set var="nextTopic" value="${requestScope.NextTopic}" />
    <c:set var="offset" value="${requestScope.offset}" />
    <c:set var="threadID_int" value="${requestScope.thread}" />
    <c:if test="${threadBean.threadID != threadID_int}">
        The two threadID are not the same.
    </c:if>
    <c:set var="threadID" value="${threadID_int}" />
    <%-- the code before this line works fine and I have a number of things displayed as expected --%>
    <c:forEach var="postBean" items="{postRows}" varStatus="i">
    <% PostBean postBean =
       ( PostBean )pageContext.getAttribute( "postBean" );
    %>
       <c:choose>
          <c:when test="${(postBean.parentPostID) eq 0}">
             <c:set var="background" value="#FFCE9C" />
          </c:when>
          <c:otherwise>
             <c:choose>
                <c:when test="${(i+1)%2 ne 0}">
                   <c:set var="background" value="#EEEEEE" />
                </c:when>
                <c:otherwise>
                   <c:set var="background" value="#FFFFFF" />   
                </c:otherwise>
             </c:choose>
          </c:otherwise>
       </c:choose>
    <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
      <tr bgColor="${background}">
      </tr>
    </table>
    </c:forEach>

    Where is the null occuring? Have you looked at the returned HTML code to see where the 'null' is?
    You might try just a few <c:out value=""/>, like:
    The postRows = <c:out value="${postRows"/><br/>
    <c:forEach var="postBean" items="${postRows"/>
      The Current postBean = <c:out value="${postBean}"/><br/>
      The Current parentPostID = <c:out value="${postBean.parentPostID eq 0}"/><br/>
      <!-- Only do this set if background ends up null, to make sure the scope of background is wide enough -->
      <c:set var="background" value="#FFFFFF"/>
      <c:choose>
        <c:when test="${postBean.parentPostID eq 0}">
          <c:set var="background" value="#FFCE9C"/>
        </c:when>
        <c:when test="${(i+1)%2 ne 0}">
          <c:set var="background" value="#EEEEEE"/>
        </c:when>
        <c:otherwise>
          <c:set var="background" value="#FFFFFF"/>
        </c:otherwise>
      </c:choose>
      The Background is now = <c:out value="${background}"/><br/>
      <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
        <tr bgColor="${background}">
        </tr>
      </table>
    </c:forEach>By adding output like that when we are debugging we can help track down where problems that occur are coming from. That and looking at the source code have been invaluable to me...

  • Can you set pager attribute using jstl c:out tag?

    I am trying to use the pager tag library from jsptags.com. The pager tag has a maxPageItems attribute. I want maxPageItems to be variable. I also want to use the jstl instead of scriptlets and expressions. Instead of writing
    <pg:pager
        maxPageItems="<%= myPageItems %>" >I want to write
    <pg:pager
        maxPageItems="<c:out value='myPageItems'/>">When I do this I get a java.lang.NumberFormatException: for input string: ""
    I think this issue is documented on the jsptags website. So maybe I have no choice but to use the expression format. I guess I should also mention that I am using jstl 1.1 and jsp 1.2 (implemented in tomcat 4.1.27)
    Has anyone tried this and had success?
    Did I provide enough information?

    Sorry, but you can't use tags as attributes to other tags (where would it end?)
    You're stuck with using <%= %> syntax.

  • Apex 4.2: Date picker & format mask number

    Hello
    In Apex 4.2, in a Date Item, how can I modify the date picker to set Monday as the start of week day? I can set Monday as the start of week day on a calendar, but not in a Date Item.
    In a Number Item, there's no format mask to set the comma char as a decimal separator and the dot char as a thousand separator. How can I create a new format mask number?
    Thank you.
    Edited by: user7034195 on 12-mar-2013 3:24

    for the Date Item, you can check this link, you have to call the process on the page load
    http://stackoverflow.com/questions/1313317/set-start-day-of-the-week-in-jquery-ui-datepicker
    and for the Number format, there's a little trick involved, will try to explain
    First of all convert you items from Number field to simple Textfield.
    1. Write this in your items Post Calculation Computation: TO_CHAR (:item_name, '999G999G999G999G990D00', 'NLS_NUMERIC_CHARACTERS = '',.''')This will do the number formatting you want, but in oracle above format is not acceptable, so while submitting the above values to database we need to undo the changes for that you can use the below code.
    2. Create a Computation "After Submit" for every item you did the above formatting and copy this code in it: replace(replace('1.00.00,00','.',''),',','.') for the 2nd step you can create a package/function which will get the items value as string and do the conversion as number using above code and return back the number.
    This should help you.
    Regards,
    Tauceef

  • Can I use WinXP Home serial number using WinXP Pro install disc

    Hello everyone,
    I am going to downgrade from Vista to XP (my DELL machine was originally XP Home) but I don't have my old XP install files anymore.  I did do have a Windows XP Professional SP3 install disc.  My question is:  Would I be able to use my serial number using the WinXP Pro install disc for a clean install?  (I am going to format my C drive.)
    Thanks!

    Hey there! You would not be able to use the Home Key with a Professional disc.
    Adam
    Best Buy Community - Retail, Americas
    Forum Guidelines | Terms & Conditions | Community Guidelines | Blogging Guidelines
    *Remember to mark your questions solved and click the star under the user's name to show your thanks!

  • Formatting a number

    hi all,
    help me out .. iam facing problem with formatting a text....
    for ex: i want to format a number 34347.98 to 34'347.98 using NumberFormat class.... but iam not able to get it.
    help me how to format above its very urgent....
    thanks
    Naresh G

    Wouldn't a new DecimalFormat("##'###.##') do the trick?
    kind regards,
    Jos

  • RE: (forte-users) Formatting a number

    Thank you. That worked out great.
    ka
    -----Original Message-----
    From: Thompson Ian [mailto:Ian.Thompsonicl.com]
    Sent: Friday, February 18, 2000 9:35 AM
    To: 'Amin, Kamran'; 'Forte User'
    Subject: RE: (forte-users) Formatting a number
    Ka,
    Try using TextFormat in combination with NumericFormat - like this:
    strfmt : TextFormat = new;
    numfmt : NumericFormat = new;
    number : IntegerData = new;
    numberastext : TextData;
    numfmt.Template='L0000000';
    strfmt.Template='A###-####';
    number.SetValue(source = 23456);
    // Format the number into a TextData.
    numberastext=strfmt.FormatText(source = numfmt.FormatNumeric(source =
    number));
    You may have tried this already, but I hope it helps.
    Regards
    Iain
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: 18 February 2000 13:37
    To: 'Forte User'
    Subject: (forte-users) Formatting a number
    I like to format a number as follows:
    L###-#### - Where a number like 23456 would format to L002-3456.
    Is there any way to do this in Forte using the NumericFormat object.
    thanks in advance.
    ka
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Thank you. That worked out great.
    ka
    -----Original Message-----
    From: Thompson Ian [mailto:Ian.Thompsonicl.com]
    Sent: Friday, February 18, 2000 9:35 AM
    To: 'Amin, Kamran'; 'Forte User'
    Subject: RE: (forte-users) Formatting a number
    Ka,
    Try using TextFormat in combination with NumericFormat - like this:
    strfmt : TextFormat = new;
    numfmt : NumericFormat = new;
    number : IntegerData = new;
    numberastext : TextData;
    numfmt.Template='L0000000';
    strfmt.Template='A###-####';
    number.SetValue(source = 23456);
    // Format the number into a TextData.
    numberastext=strfmt.FormatText(source = numfmt.FormatNumeric(source =
    number));
    You may have tried this already, but I hope it helps.
    Regards
    Iain
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: 18 February 2000 13:37
    To: 'Forte User'
    Subject: (forte-users) Formatting a number
    I like to format a number as follows:
    L###-#### - Where a number like 23456 would format to L002-3456.
    Is there any way to do this in Forte using the NumericFormat object.
    thanks in advance.
    ka
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

Maybe you are looking for

  • Error while opening GRPO document

    Dear Experts, I am using SAP B1 8.8 and SQL Server 2008 in Server and SAP B1 and SQL Server 2005 in Test System. I have tested one scenario, In GRPO Document, Total amount should be calculated based on Unit price * 0.2812 * Net weight. In Test system

  • End User Role for Service Desk in Solution Manager

    Hey, I am launching the Service Desk functionality for my End Users. One thing that i want to know of is the role that I should assign my user in Solution Manager to access his message. E.g. I have a user 'A' who creates a message from any system in

  • How to integrate a .abc file into swf by using mxmlc?

    Enviroment: CrossBridge1.0.1, Flex SDK 4.6 I use g++ to compile 2 .cc files (the c2as wrapper) & a .a file (the logic)  into a .swc file; then use this .swc as a library for mxmlc to compile the main .as file. The Makefile is as follows: "$(FLASCC)/u

  • Not supported by server versionORAOLAP9.2.0.1.0

    bi_checkconfig -h mayx-move -po 1521 -sid majin -u BIB DEMO -p BIBDEMO I am geting message: BI Beans Diagnostics(v1.0.0.0) 03-5-19 =============================================================================== JDEV_ORACLE_HOME ......................

  • Sql script in UNIX

    When I run a sql script in unix using sqlplus command, the process halts at some point. No matter how long I wait, it does not finish (it does not bring the command prompt back). There are no problems in SQL*PLUS. This process usually takes about 30