Skip to content

Instantly share code, notes, and snippets.

@riatw
Created September 13, 2019 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riatw/05efb09dc7271a0ca0e258a1d6996e05 to your computer and use it in GitHub Desktop.
Save riatw/05efb09dc7271a0ca0e258a1d6996e05 to your computer and use it in GitHub Desktop.
サイト内の税抜き価格から税込み金額を計算する
var array = $("body").text().match(/(消費税抜き .*?円)/gm);
var stash = [];
if ( array.length > 0 ) {
for( var i = 0; i < array.length; i++ ){
stash.push( Math.floor( array[i].replace(/(消費税抜き (.*?)円)/,"$1").replace(/,/gm,"") * 1.1 ).toLocaleString() );
}
}
console.log(stash.join("\n"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment