Bug 152033

Summary: Web Inspector: Adopt Number.prototype.toLocaleString For All Sizes and Times
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 147605    
Bug Blocks:    
Attachments:
Description Flags
[Patch] Proposed Fix none

Timothy Hatcher
Reported 2015-12-08 20:10:35 PST
We can make our number utilities use this to get proper localization for numbers.
Attachments
[Patch] Proposed Fix (21.44 KB, patch)
2016-04-15 12:43 PDT, Matt Baker
no flags
Radar WebKit Bug Importer
Comment 1 2015-12-08 20:11:00 PST
Timothy Hatcher
Comment 2 2015-12-08 20:11:25 PST
Timothy Hatcher
Comment 3 2015-12-09 11:24:34 PST
Blaze Burg
Comment 4 2015-12-17 14:20:25 PST
This won't do anything (formatting or locale-specific formatting) until Intl.NumberFormat is implemented.
Matt Baker
Comment 5 2016-04-15 12:43:45 PDT
Created attachment 276496 [details] [Patch] Proposed Fix
Joseph Pecoraro
Comment 6 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).
Matt Baker
Comment 7 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.
WebKit Commit Bot
Comment 8 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>
WebKit Commit Bot
Comment 9 2016-04-16 18:25:58 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.