import Ember from 'ember';

export default Ember.Component.extend({
  tagName: "badge",
  classNameBindings: ["name", "value"],
  imagePath: function() {

  }.property("model.name", "model.level"),
  percentage: function() {
    var level = this.get("badge.level");
    if(Ember.isEmpty(level)) {
      return "100";
    }
    var percentage = Math.round(((level - 1) / 4) * 100);
    return `${percentage}`
  }.property("badge.level")
});

import Ember from 'ember';

export default Ember.Component.extend({
  tagName: "badge",
  classNameBindings: ["name", "value"],
  imagePath: function() {

  }.property("model.name", "model.level"),
  percentage: function() {
    var level = this.get("badge.level");
    if(Ember.isEmpty(level)) {
      return 100;
    }
    var percentage = Math.round(((level - 1) / 4) * 100);
    return percentage;
  }.property("badge.level"),
  inversePercentage: function() {
    return 100-this.get("percentage");
  }.property("percentage"),
});

Use numbers not strings in %, plus need inverse percentage
Use numbers not strings in %, plus need inverse percentage
