You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Ashwin Prabhu (JIRA)" <de...@myfaces.apache.org> on 2014/07/24 09:36:39 UTC

[jira] [Created] (TRINIDAD-2496) Support custom negative prefix and suffix on af:convertNumber

Ashwin Prabhu created TRINIDAD-2496:
---------------------------------------

             Summary: Support custom negative prefix and suffix on af:convertNumber
                 Key: TRINIDAD-2496
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2496
             Project: MyFaces Trinidad
          Issue Type: Improvement
          Components: Components
            Reporter: Ashwin Prabhu


This is an enhancement request of af:convertNumber (converter class is
NumberConverter) to support additional conversion function for negative
numbers.

It is expected to enhance af:convertNumber (converter class is
NumberConverter) to support the following:
 1. new attribute of negativePrefix and negativeSuffix
 2. parsing/formatting support in both client and server side using negative
    prefix/suffix

--------------------------------------------------------------------------------------
Problem description:

Financial applications sometimes require that negative numbers be displayed within () instead of the usual -ve prefix. Ex: -1234 as (1234). 

Currently Trinidad based applications can achieve this by specifying a pattern on the number converter, like for example "#;(#)". This works, but the caveat is that patterns are not processed by the client converter. So essentially to parse and format numbers, the application must wait until the input is eventually submitted to the server or perform a auto-submit to expedite the validation. Performing auto-submit to validate the input for converter pattern compliance is noticeably slow and wastes a server round trip. So the request is to enhance the client converter to parse/format numbers with suffix/prefix on the client and this should work for all types: number, percent, currency(already works). 



--
This message was sent by Atlassian JIRA
(v6.2#6252)