Changeset 47095 in webkit
- Timestamp:
- Aug 12, 2009 12:59:56 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r47094 r47095 1 2009-08-12 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Changed Number.bytesToString to support low-resolution output. 6 7 https://bugs.webkit.org/show_bug.cgi?id=28146 8 9 * inspector/front-end/utilities.js: 10 (Number.bytesToString): 11 1 12 2009-08-12 Prasanth Ullattil <prasanth.ullattil@nokia.com> 2 13 -
trunk/WebCore/inspector/front-end/utilities.js
r46848 r47095 791 791 } 792 792 793 Number.bytesToString = function(bytes, formatterFunction )793 Number.bytesToString = function(bytes, formatterFunction, higherResolution) 794 794 { 795 795 if (!formatterFunction) 796 796 formatterFunction = String.sprintf; 797 if (typeof higherResolution === "undefined") 798 higherResolution = true; 797 799 798 800 if (bytes < 1024) … … 800 802 801 803 var kilobytes = bytes / 1024; 802 if ( kilobytes < 1024)804 if (higherResolution && kilobytes < 1024) 803 805 return formatterFunction("%.2fKB", kilobytes); 806 else if (kilobytes < 1024) 807 return formatterFunction("%.0fKB", kilobytes); 804 808 805 809 var megabytes = kilobytes / 1024; 806 return formatterFunction("%.3fMB", megabytes); 810 if (higherResolution) 811 return formatterFunction("%.3fMB", megabytes); 812 else 813 return formatterFunction("%.0fMB", megabytes); 807 814 } 808 815
Note: See TracChangeset
for help on using the changeset viewer.