Skip to content

Instantly share code, notes, and snippets.

@pierr
Last active August 29, 2015 14:11
Show Gist options
  • Save pierr/765f6f1818c94ccc3f2f to your computer and use it in GitHub Desktop.
Save pierr/765f6f1818c94ccc3f2f to your computer and use it in GitHub Desktop.
formatter
function(){
if(!jQuery){
throw new Error('JQuery should be define');
}
$.fn.percentify = function(options){
function parseValue(value){
//Code à faire pour parser la valeur.
return value.slice(0,-1);
}
function displayValue(value){
return +(value)*100 +" %";
}
if(options === "val"){
return this;
}
};
}();
function formatPourcent(prop, options){
if(!prop){
throw new Error('Poucent ...')
}
var val = +prop;
return ""+ val * 100 + '%';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment