Last active
November 25, 2019 18:12
-
-
Save manuganji/6053226 to your computer and use it in GitHub Desktop.
Revisions
-
manuganji revised this gist
Jul 22, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ height_val = $("#id_height").val(); var regex_op = /^(\d{1,2})[\']?((\d)|([0-1][0-2]))?[\"]?$/g.exec(height_val); //very rare chance for someone to be of two digit feet height. //but i put it there, just in case. var feet = regex_op[1]; -
manuganji revised this gist
Jul 22, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ height_val = $("#id_height").val(); var regex_op = /^(\d{1,2})[\']?((\d)|(1[0-2]))?[\"]?$/g.exec(height_val); //very rare chance for someone to be of two digit feet height. //but i put it there, just in case. var feet = regex_op[1]; var inches = regex_op[2]; // converting to inches var height = (parseInt(feet) || 0) * 12 + (parseInt(inches) || 0); -
manuganji created this gist
Jul 22, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ height_val = $("#id_height").val(); var regex_op = /^(\d{1,2})[\']?((\d)|(1[0-2]))[\"]?$/g.exec(height_val); //very rare chance for someone to be of two digit feet height. //but i put it there, just in case. var feet = regex_op[1]; var inches = regex_op[2]; // converting to inches var height = parseInt(feet) * 12 + parseInt(inches);