OFBiz
  1. OFBiz
  2. OFBIZ-490

UtilFormatOut to use default.currency.decimals

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: SVN trunk
    • Component/s: framework
    • Labels:
      None

      Description

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

        Issue Links

          Activity

          Hide
          Jacques Le Roux added a comment -

          I believe this is not needed anymore since r551625 and sequel

          Show
          Jacques Le Roux added a comment - I believe this is not needed anymore since r551625 and sequel
          Hide
          Jacques Le Roux added a comment -

          Since then Scott's supplied a patch in OFBIZ-937. But it seems that a more general external parameter as suggested by Si and Daniel is still missing. Am I correct ? Is a such external parameter desirable ? Would it not interfere with what is existing ?

          Show
          Jacques Le Roux added a comment - Since then Scott's supplied a patch in OFBIZ-937 . But it seems that a more general external parameter as suggested by Si and Daniel is still missing. Am I correct ? Is a such external parameter desirable ? Would it not interfere with what is existing ?
          Hide
          Jacques Le Roux added a comment -

          FYI, the comments in code are as follow

          OfbizCurrencyTransform.java

                  // 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;
          

          ModelFormField.java

          retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale, 10); // we set the max to 10 digits as an hack to not round numbers in the ui
          
          Show
          Jacques Le Roux added a comment - FYI, the comments in code are as follow OfbizCurrencyTransform.java // 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; ModelFormField.java retVal = UtilFormatOut.formatCurrency(parsedRetVal, isoCode, locale, 10); // we set the max to 10 digits as an hack to not round numbers in the ui
          Hide
          Jacques Le Roux added a comment -

          Nothing really happened from this issue. Should we continue to keep it open ? Should we apply Si recommandation ? What do you people think ?

          Thanks

          Show
          Jacques Le Roux added a comment - Nothing really happened from this issue. Should we continue to keep it open ? Should we apply Si recommandation ? What do you people think ? Thanks
          Hide
          Daniel Kunkel added a comment -

          It seems like the number of decimals is much more of a constant depending on the currency. Could that information be better set and stored with the currency data?

          Show
          Daniel Kunkel added a comment - It seems like the number of decimals is much more of a constant depending on the currency. Could that information be better set and stored with the currency data?

            People

            • Assignee:
              Andrew Zeneski
              Reporter:
              Si Chen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development