[jira] Commented: (OFBIZ-490) UtilFormatOut to use default.currency.decimals

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-490) UtilFormatOut to use default.currency.decimals

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680137#action_12680137 ]

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

FYI, the comments in code are as follow

OfbizCurrencyTransform.java
{code}
        // check the rounding -- DEFAULT is 10 to not round for display, only use this when necessary
        // rounding should be handled by the code, however some times the numbers are coming from
        // someplace else (i.e. an integration)
        int roundingNumber = getInteger(args, "rounding");
        if (roundingNumber == 0) roundingNumber = 10;
        final int rounding = roundingNumber;
{code}

ModelFormField.java
{code}
retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale, 10); // we set the max to 10 digits as an hack to not round numbers in the ui
{code}

> UtilFormatOut to use default.currency.decimals
> ----------------------------------------------
>
>                 Key: OFBIZ-490
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-490
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Si Chen
>            Priority: Minor
>
> I looked through utilFormatOut.formatCurrency and the way that it is called from OfbizCurrencyTransform and the ModelFormField, it currently does not set a maximum digit.
> I propose that we add a default.currency.decimals into general.properties and then modify UtilFormatOut.formatCurrency so that if this is set, then the default number of decimals is set from this property after the locale has been set.  (If it is set before the Locale it will not work.)

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