![]() |
|
[Javascript] Convert something loaded from website to an int and multiply - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [Javascript] Convert something loaded from website to an int and multiply (/showthread.php?tid=5806319) |
Convert something loaded from website to an int and multiply - Konstantinos - Mar 1, 2018 So, I want to put that in a variable (var total_rece_btc), the load part, where it is being converted to an INT and multiplied by 0.00000001 Code $('#total_received_btc').load('https://blockchain.info/q/addressbalance/' + '1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj' + '?confirmations=0');Thanks in advance 🤝 RE: Convert something loaded from website to an int and multiply - Nachfolger - Mar 1, 2018 Does that page return a string or something? Do: Code parseInt(total_rece_btc) * 0.000001I'm not sure why you're using .load to get the variable. Do this instead: Code $.get('https://blockchain.info/q/addressbalance/' + '1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj' + '?confirmations=0', function(d) {RE: Convert something loaded from website to an int and multiply - Konstantinos - Mar 1, 2018 (Mar 1, 2018 02:19 PM)Nachfolger Wrote: Does that page return a string or something? Tried this thing, wont work: Code var total_received_btc = parseInt(load('https://blockchain.info/q/addressbalance/' + '1EzwoHtiXB4iFwedPr49iywjZn2nnekhoj' + '?confirmations=0')) * 0.000001;RE: Convert something loaded from website to an int and multiply - Nachfolger - Mar 1, 2018 (Mar 1, 2018 02:29 PM)Kwast Wrote: Tried this thing, wont work:What even are you doing. I just told you how to do it. RE: Convert something loaded from website to an int and multiply - Konstantinos - Mar 1, 2018 (Mar 1, 2018 02:29 PM)Nachfolger Wrote: What the fuck are you doing. I just told you how to do it. Sorry, I forgot to check your edited post and edit my own as well, your code worked, thanks 🤝 |