Commit d362f807 authored by Marc Duez's avatar Marc Duez
Browse files

model.js : formatSize(size) > return size with current notation type used by model

parent 917c7231
......@@ -1297,6 +1297,32 @@ Model.prototype = {
},
formatSize : function (size, fixed) {
var result = "-/-"
if (size == 0) return result
switch (this.notation_type){
case "percent" :
if (fixed){
if (size<0.0001){
result=(100*size).toFixed(4)+"%";
}else if (size > 0.1){
result=(100*size).toFixed(2)+"%";
}else{
result=(100*size).toFixed(3)+"%";
}
}else{
result=(100*size)+"%";
}
break;
case "scientific" :
result=(size).toExponential(1);
break;
}
return result
},
}//end prototype Model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment