Preparing search index...

    Function formatDecimalForStorage

    • Formats a number for persistence, independent of the device region.

      Parameters

      • value: number

        The numeric value to format

      • maxDecimals: number

        Maximum number of fractional digits to keep

      Returns string

      The formatted string, using storageDecimalSeparator

      formatDecimalForStorage(133.33333, 4) // returns '133,3333'
      formatDecimalForStorage(200, 2) // returns '200'