You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Leon Torres (JIRA)" <ji...@apache.org> on 2007/05/22 01:26:16 UTC

[jira] Created: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Set decimal places to show for ofbizCurrencyTransform
-----------------------------------------------------

                 Key: OFBIZ-1007
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
             Project: OFBiz (The Open for Business Project)
          Issue Type: Improvement
          Components: framework
    Affects Versions: Release Branch 4.0
            Reporter: Leon Torres
            Priority: Minor


Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.

The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.

Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.

I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547314 ] 

Jacques Le Roux commented on OFBIZ-1007:
----------------------------------------

Leon,

I tried to apply your patch but there are some conflicts, could you please create an updated patch ?

Thanks

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Priority: Minor
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-1007:
--------------------------------------

    Assignee: Jacques Le Roux

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754640#action_12754640 ] 

Jacques Le Roux commented on OFBIZ-1007:
----------------------------------------

FYI : this is handled differently in OFBiz, see for instance OFBIZ-937

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-1007.
----------------------------------

    Resolution: Fixed
      Assignee: Jacques Le Roux  (was: Scott Gray)

This has been done recently see OFBIZ-3200


> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Gray reopened OFBIZ-1007:
-------------------------------

      Assignee: Scott Gray  (was: Jacques Le Roux)

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Assignee: Scott Gray
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Leon Torres (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leon Torres updated OFBIZ-1007:
-------------------------------

    Attachment: currency-decimal-places.patch

The currency-decimal-places.patch file contains my proposed solution.  It allows the user to define the number of decimal places to display in the context that requires it.

An improvement on this patch would be to have a configurable property value to use by default.

Ideally, we would also have some kind of rounding mode and scale setting, so the numbers could be rounded properly.  Currently that detail is being delegated to the com.ibm.icu.NumberFormatter class.

- Leon

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Priority: Minor
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (OFBIZ-1007) Set decimal places to show for ofbizCurrencyTransform

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-1007.
----------------------------------

       Resolution: Later
    Fix Version/s: SVN trunk

> Set decimal places to show for ofbizCurrencyTransform
> -----------------------------------------------------
>
>                 Key: OFBIZ-1007
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1007
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: Release Branch 4.0
>            Reporter: Leon Torres
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: currency-decimal-places.patch
>
>
> Some users may wish to have 3 or 4 decimal places of precision in currency amounts.  This is easily configurable with the fieldtype XML files.
> The problem is that the <@ofbizCurrencyTransform> macro will truncate the numbers because the decimal places is determined from the Locale object, and there is no way to tell it that the decimal places should be 3 or 4 or whatever.
> Additionally, these users often have the desire to right pad the numbers with zeroes.  For instance, an amount of $3.04 should be displayed as $3.0400 for a 4 decimal place requirement.   Currently the UtilFormatOut.formatCurrency() methods have no way to support this right-filling of zeros in this manner.
> I have implemented a fairly elegant way of solving both related issues with minimal impact.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.