gengliangwang commented on a change in pull request #32224:
URL: https://github.com/apache/spark/pull/32224#discussion_r630187803
##########
File path: core/src/main/resources/org/apache/spark/ui/static/sorttable.js
##########
@@ -505,3 +521,27 @@ var forEach = function(object, block, context) {
}
};
+// getStorageSize from str like '9.75 Mib'/'1290 B'
+function storageSizeConverter(data) {
+ var data = data.toString();
+ var multipliers = {
+ b: 1,
+ kib: 1024,
+ mib: 1048576,
+ gib: 1073741824,
+ tib: 1099511627776,
+ pib: 1125899906842624,
+ eib: 1152921504606846976,
+ zib: 1180591620717411303424,
+ yib: 1208925819614629174706176,
+ };
+
+ var matches = data.match(/^(\d+(\.\d+)?)\s*(b|[k|m|g|t|p|e|z|y]ib)/i);
+
+ if (matches) {
+ var unit = matches[2].toLowerCase();
Review comment:

The unit won't have to be match[2]
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]