Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

How is fmt:formatNumber used?

  • 03-09-2012 3:43pm
    #1
    Closed Accounts Posts: 6,075 ✭✭✭


    I am trying to format a percentage to 2 decimal places and the code I am using is not working.
    <form:input 
         class="calculator-percentage-input"
         value="<fmt:formatNumber value='${percentage}' maxFractionDigits='2'/>"
         path="discount" cssErrorClass="error"
    />
    

    The value displayed in my input box is (percentage is empty):
    <fmt:formatNumber value='' maxFractionDigits='2'/>
    
    Can anyone tell me how to just display the value of 'percentage'?


Comments

  • Closed Accounts Posts: 6,075 ✭✭✭IamtheWalrus


    Solution:

    <fmt:formatNumber var='myDiscountPercentage' value='${discountPercentage}' maxFractionDigits='2'/>

    <form:input
    class="calculator-percentage-input"
    value="${myDiscountPercentage}"
    path="discount" cssErrorClass="error"
    />


Advertisement