define(['underscore', 'models/base'], function(_, Base) {

    /*
    {
        "occupancy": 0,
        "total": 1,
        "remaining": 1,
        "active": true,
        "alias": "1",
        "name": "tiny1",
        "provider": 4,
        "cpu": 1,
        "disk": 30,
        "root": 0,
        "mem": 4096
    }
    */

    var Size = Base.extend({
        defaults: { 'model_name': 'size' },
        parse: function(attributes) {
            attributes.id = attributes.alias;
            return attributes;
        },
        formattedDetails: function() {
            var memoryGB = this.get('mem') / 1024;
            var parts = [this.get('cpu') + ' CPUs',
                         memoryGB + ' GB memory',
                         this.get('disk') + ' GB disk'];
            return this.get('name') + " (" + parts.join(', ') + ")";
        }
    });

    _.extend(Size.defaults, Base.defaults);

    return Size;

});

@@ -318,16 +318,411 @@
     */%0A%0A
+    var statics = %7B%0A        format_megabytes: function(mb) %7B%0A            var memoryScalar = mb;%0A            var memoryUnits = %22MB%22;%0A            if (mb %3E 1024) %7B%0A                var digits = mb %25 1024 == 0 ? 0 : 1;%0A                memoryScalar = (mb / 1024).toFixed(digits);%0A                memoryUnits = %22GB%22;%0A            %7D%0A            return memoryScalar + %22 %22 + memoryUnits;%0A        %7D%0A    %7D;%0A%0A
     var 
@@ -742,16 +742,16 @@
 xtend(%7B%0A
-
         
@@ -955,59 +955,8 @@
 ) %7B%0A
-            var memoryGB = this.get('mem') / 1024;%0A
     
@@ -1032,31 +1032,58 @@
     
-memoryGB
+Size.format_megabytes(this.get('mem'))
  + '
- GB
  memory'
 ,%0A  
@@ -1078,17 +1078,18 @@
  memory'
-,
+%5D;
 %0A       
@@ -1093,29 +1093,65 @@
         
-             
+if (this.get('disk'))%0A                parts.push(
 this.get
@@ -1171,19 +1171,113 @@
 GB disk'
-%5D
+)
 ;%0A
+            if (this.get('root'))%0A                parts.push(this.get('root') + ' GB root');%0A%0A
         
@@ -1347,21 +1347,30 @@
       %7D%0A
-
     %7D
+, statics
 );%0A%0A    

Fix size formatting for memory megabytes