migration of open-etc-friends-pool for use with Etica/EGAZ
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
347 B

import Ember from 'ember';
export function withMetricPrefix(params/*, hash*/) {
var n = params[0];
if (n < 1000) {
return n;
}
var i = 0;
var units = ['K', 'M', 'G', 'T', 'P'];
while (n > 1000) {
n = n / 1000;
i++;
}
return n.toFixed(2) + ' ' + units[i - 1];
}
export default Ember.Helper.helper(withMetricPrefix);