Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          roundFinancial(value, precision)

          roundFinancial(value, precision)

          This function returns a value that’s rounded financially to the specified number of digits in the precision parameter.

          Required Editions

          Available in Lightning Experience in Professional, Unlimited, and Enterprise Editions that have Consumer Goods Cloud enabled.

          Parameters

          • value: Decimal value to round.
          • precision: Number of digits to round to an integer.

          Returns

          • value: Decimal value that’s rounded financially to the specified number of digits.

          Example

          Sample Usage

          Utils.roundFinancial(2.11,0)

          Utils.roundFinancial(-1.91,1)

          Example Results of roundFinancial(value, precision)

          Value Precision Result
          -1.91 0 -2
          -1.91 1 -1.9
          -1.91 2 -1.91
          1.91 0 2
          1.91 1 1.9
          1.91 2 1.91
          7.86 0 8
          7.86 1 7.9
          7.86 2 7.86
          4.99 0 5
          4.99 1 5
          4.99 2 4.99
          12.344 0 12
          12.344 1 12.3
          12.344 2 12.34
          16.367 0 16
          16.367 1 16.4
          16.367 2 16.37
           
          Loading
          Salesforce Help | Article