Bug 28146 - Allow Inspector's Number.toString to print low-resolution values
Summary: Allow Inspector's Number.toString to print low-resolution values
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
Depends on:
Reported: 2009-08-10 07:08 PDT by Mikhail Naganov
Modified: 2009-08-12 01:00 PDT (History)
3 users (show)

See Also:

Proposed change (1.79 KB, patch)
2009-08-10 07:15 PDT, Mikhail Naganov
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Naganov 2009-08-10 07:08:37 PDT
Currently, Number.toString always prints high-resolution values in KBs and MBs (e.g. 1.234MB). My intention is to allow it to print coarse-grained values (no digits after the decimal point.)
Comment 1 Mikhail Naganov 2009-08-10 07:15:36 PDT
Created attachment 34450 [details]
Proposed change
Comment 2 Timothy Hatcher 2009-08-10 09:14:23 PDT
What is the reason for this addition?
Comment 3 Mikhail Naganov 2009-08-11 00:12:19 PDT
I'm working on the heap profiling page for Chromium. I have one place where I'm displaying memory stats (as a subtitle for memory snapshot items), and there I don't need excessive precision provided by the default version of Number.bytesToString. That's why I decided to provide 'low-res' argument to it.

You can check out the current look of the Heap page here:

As I'm planning to upstream it to WebKit some day, so let's discuss it. The current view is very simple, I have more functionality to add.
Comment 4 Pavel Feldman 2009-08-12 01:00:24 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/utilities.js
Committed r47095