Bug 152033 - Web Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
Summary: Web Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on: 147605
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-08 20:10 PST by Timothy Hatcher
Modified: 2016-04-16 18:25 PDT (History)
8 users (show)

See Also:


Attachments
[Patch] Proposed Fix (21.44 KB, patch)
2016-04-15 12:43 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2015-12-08 20:10:35 PST
We can make our number utilities use this to get proper localization for numbers.
Comment 1 Radar WebKit Bug Importer 2015-12-08 20:11:00 PST
<rdar://problem/23815589>
Comment 2 Timothy Hatcher 2015-12-08 20:11:25 PST
Support landed in http://trac.webkit.org/changeset/193493.
Comment 3 Timothy Hatcher 2015-12-09 11:24:34 PST
<rdar://problem/6869032>
Comment 4 Brian Burg 2015-12-17 14:20:25 PST
This won't do anything (formatting or locale-specific formatting) until Intl.NumberFormat is implemented.
Comment 5 Matt Baker 2016-04-15 12:43:45 PDT
Created attachment 276496 [details]
[Patch] Proposed Fix
Comment 6 Joseph Pecoraro 2016-04-15 12:50:47 PDT
Comment on attachment 276496 [details]
[Patch] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=276496&action=review

> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:605
> +            let value = typeof obj.value === "number" ? obj.value : obj.description;
> +            return String.standardFormatters.f(value, token);

We should have a test for this given it is a behavior change. For instance, this affects console.log("%.3f", Math.PI).
Comment 7 Matt Baker 2016-04-15 13:01:33 PDT
(In reply to comment #6)
> Comment on attachment 276496 [details]
> [Patch] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=276496&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:605
> > +            let value = typeof obj.value === "number" ? obj.value : obj.description;
> > +            return String.standardFormatters.f(value, token);
> 
> We should have a test for this given it is a behavior change. For instance,
> this affects console.log("%.3f", Math.PI).

I looked at adding console tests, but wasn't sure how to go about it since message formatting is done at the view level.
Comment 8 WebKit Commit Bot 2016-04-16 18:25:55 PDT
Comment on attachment 276496 [details]
[Patch] Proposed Fix

Clearing flags on attachment: 276496

Committed r199635: <http://trac.webkit.org/changeset/199635>
Comment 9 WebKit Commit Bot 2016-04-16 18:25:58 PDT
All reviewed patches have been landed.  Closing bug.