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:30:16 UTC

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

     [ 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.