Last active
August 29, 2015 14:11
-
-
Save pierr/765f6f1818c94ccc3f2f to your computer and use it in GitHub Desktop.
formatter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
}; | |
}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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