Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2017-05-29 18:04:47 +0300
committerFilipa Lacerda <filipa@gitlab.com>2017-05-29 18:04:47 +0300
commit069783b5ccda2eb89f9c953334e2e9a6b809066e (patch)
tree554538bc23cc2da9915e0b046c501c363d79b12a /app/assets/javascripts/lib
parent437bb9282c90ac0ac8c3c87386b3220c33d2b4b4 (diff)
Add performance deltas between app deployments on Merge Request widget
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r--app/assets/javascripts/lib/utils/number_utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/number_utils.js b/app/assets/javascripts/lib/utils/number_utils.js
index f1b07408671..57394097944 100644
--- a/app/assets/javascripts/lib/utils/number_utils.js
+++ b/app/assets/javascripts/lib/utils/number_utils.js
@@ -42,3 +42,13 @@ export function formatRelevantDigits(number) {
export function bytesToKiB(number) {
return number / BYTES_IN_KIB;
}
+
+/**
+ * Utility function that calculates MiB of the given bytes.
+ *
+ * @param {Number} number bytes
+ * @return {Number} MiB
+ */
+export function bytesToMiB(number) {
+ return number / (BYTES_IN_KIB * BYTES_IN_KIB);
+}