Commit 843efc9d authored by Marc Duez's avatar Marc Duez
Browse files

model.js : clones sizes are displayed in two possible notation (scientific or percent)

parent 8c845f31
......@@ -730,20 +730,29 @@ Model.prototype = {
/* return the clone size with a fixed number of character
* use scientific notation if neccesary
* */
getStrSize : function(cloneID){
var size = this.getSize(cloneID);
var result;
if (size==0){
result="-∕-";
}else{
if (size<0.0001){
result=(size).toExponential(1);
}else{
result=(100*size).toFixed(3)+"%";
}
}
return result
},
getStrSize : function(cloneID){
var size = this.getSize(cloneID);
var result;
if (size==0){
result="-∕-";
}else{
switch (this.notation_type){
case "percent" :
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)+"%";
}
break;
case "scientific" :
result=(size).toExponential(1);
break;
}
}
return result
},
/* return the clone color
*
......
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