Revision f8940d5d

View differences:

src/sunstone/public/app/tabs/vms-tab/dialogs/disk-resize.js
82 82
    Tips.setup(context);
83 83
    $( ".diskSlider", context).html(RangeSlider.html({
84 84
        min: that.diskSize,
85
        max: Humanize.sizeToMB("500GB"),
85
        max: Humanize.sizeToMB("500GB")*1024,
86 86
        initial: that.diskSize,
87 87
        name: "resize"
88 88
    }));
......
99 99
    });
100 100

  
101 101
    $( ".uinput-slider-val", context).on("change", function(){
102
      $( ".uinput-slider",context).val(Humanize.sizeToMB($( ".uinput-slider-val",context).val()));
102
      $( ".uinput-slider",context).val(Humanize.sizeToMB(($( ".uinput-slider-val",context).val()).toString())*1024);
103 103
      var cost = Humanize.sizeToMB($( ".uinput-slider",context).val())*that.diskCost;
104 104
      if(isNaN(cost)){
105 105
        cost = 0;
src/sunstone/public/app/utils/humanize.js
101 101
    var factor = split[0].slice(-1);
102 102
    var number = parseFloat(split[0]);
103 103
    if(factor=="K")
104
      number = number * 1024;
104
      number = number / 1024;
105 105
    else if(factor=="G")
106
      number = number * 1024 * 1024;
106
      number = number * 1024;
107 107
    else if(factor=="T")
108
      number = number * 1024 * 1024 * 1024;
108
      number = number * 1024 * 1024;
109 109
    return number;
110 110
  }
111 111

  

Also available in: Unified diff