[Webkit-unassigned] [Bug 249231] New: Intl.NumberFormat producing different results when compared to Chrome/FF

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 13 09:36:53 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=249231

            Bug ID: 249231
           Summary: Intl.NumberFormat producing different results when
                    compared to Chrome/FF
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cunha.pedro.m at gmail.com

When using Intl.NumberFormat in combination with formatToParts there are inconsistencies with the Chrome/Firefox implementation. This was working fine in v15 of Safari but has since broken somewhere between 15.3 - 15.6.1, and continues to be broken in the latest version 16.1. Inconsistencies are detailed below:

1- When configuring the number format options like this:
{
    minimumFractionDigits: 0,
    maximumFractionDigits: 20,
    useGrouping: true,
    notation: 'compact',
    compactDisplay: 'short',
  }

Safari ignores the minimumFractionDigits and always rounds up or down depending on the decimal.

2- When formatting a number above 1000 Safari drops any additional fractions (unlike Chrome and FF). For example if the number is 1100, it should format to 1.1K in the compact display notation. Instead Safari drops the fraction part completely and simply formats it as 1K. Things get even stranger when formatting into the millions where Safari turns this: 1234567 into 1.2M, which is correct and consistent with other browsers. It could be that something is wrong in the handling when numbers are in the thousands.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221213/a52a34b7/attachment.htm>


More information about the webkit-unassigned mailing list