Created
April 13, 2012 17:17
-
-
Save djanix/2378457 to your computer and use it in GitHub Desktop.
js -> convert percent to number
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 convertPercentToNumber(el) { | |
if (el.charAt(el.length-1) == '%') { | |
return el.slice(0, -1)/100*duration; | |
} else { | |
return el; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment