OLD | NEW |
1 {# Copyright 2014 The LUCI Authors. All rights reserved. | 1 {# Copyright 2014 The LUCI Authors. All rights reserved. |
2 Use of this source code is governed by the Apache v2.0 license that can be | 2 Use of this source code is governed under the Apache License, Version 2.0 |
3 found in the LICENSE file. | 3 that can be found in the LICENSE file. |
4 #} | 4 #} |
5 // Formats a number into IEC 60027-2 A.2 / ISO 80000. | 5 // Formats a number into IEC 60027-2 A.2 / ISO 80000. |
6 var BINARY_SUFFIXES = [ | 6 var BINARY_SUFFIXES = [ |
7 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB' | 7 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB' |
8 ]; | 8 ]; |
9 | 9 |
10 function formatToBinaryUnit(val) { | 10 function formatToBinaryUnit(val) { |
11 // Prefer to display 1023 as 0.99KiB. | 11 // Prefer to display 1023 as 0.99KiB. |
12 for (var n = 0; val >= 1000; n++) { | 12 for (var n = 0; val >= 1000; n++) { |
13 val /= 1024; | 13 val /= 1024; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 function set_resolution_internal(res) { | 190 function set_resolution_internal(res) { |
191 document.getElementById('resolution_days').checked = false; | 191 document.getElementById('resolution_days').checked = false; |
192 document.getElementById('resolution_hours').checked = false; | 192 document.getElementById('resolution_hours').checked = false; |
193 document.getElementById('resolution_minutes').checked = false; | 193 document.getElementById('resolution_minutes').checked = false; |
194 document.getElementById('resolution_' + res).checked = true; | 194 document.getElementById('resolution_' + res).checked = true; |
195 current_resolution = res; | 195 current_resolution = res; |
196 } | 196 } |
OLD | NEW |