Skip to content

Instantly share code, notes, and snippets.

@patrickfuller
Last active April 6, 2020 17:28
Show Gist options
  • Save patrickfuller/cb1c7945345bd0a9d5bf6438f1cb8949 to your computer and use it in GitHub Desktop.
Save patrickfuller/cb1c7945345bd0a9d5bf6438f1cb8949 to your computer and use it in GitHub Desktop.
Converts inches to mm on McMaster's website.
$('.dx').each((i, el) => {
let val = $(el).html();
if (val.slice(-1) === '"') {
$(el).html((parseFloat(val.slice(0, -1)) * 25.4).toFixed(1) + ' mm');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment