Preparing search index...

    Function formatDecimalForDisplay

    • Formats a number for display using the device region's decimal separator.

      Parameters

      • value: number

        The numeric value to format

      • maxDecimals: number

        Maximum number of fractional digits to keep

      Returns string

      The formatted string, using the device region's decimal separator

      // device region FR
      formatDecimalForDisplay(0.75, 2) // returns '0,75'
      // device region US
      formatDecimalForDisplay(0.75, 2) // returns '0.75'