Brutal 164 Posted April 14, 2013 Report Share Posted April 14, 2013 Hi guys - ran into an issue that is throwing errors and hope someone can help me get on track. Here's the jist of it. 1- scrape page for certain number2- save number into var 3- some code executes that 'should' change the number i originally scraped. (but doesnt always change the number). 4- scrape page for same certain number5- save to different variable 6- setnew varvar2 - var1 = var3 7-create var4 8- var 3 is set as var49- var4 is used in ui monitor The error i'm getting is: Cannot subtract 2 strings Basically its like this: scrape a number - do stuff for the number to increase - saved to vardo the same again and save to different var (because its a different number)subtract 1 var from another var to get the difference.display the difference. its working - its returning the number as expected... but its also throwing that error. Quote Link to post Share on other sites
Anonym 53 Posted April 14, 2013 Report Share Posted April 14, 2013 Most likely there is some other junk in the strings than just numbers. have you stepped through using the debugger and checked the variables at each step? Quote Link to post Share on other sites
Brutal 164 Posted April 14, 2013 Author Report Share Posted April 14, 2013 sure have man - only "junk" would possibly be a comma ... 208,416 Update - Yes. Removed the comma and all works as expected. - Thanks man! Quote Link to post Share on other sites
Anonym 53 Posted April 14, 2013 Report Share Posted April 14, 2013 Well, if you REALLY need a comma (as a comma in numbers), then you need to keep in mind that UBot Studio is built by americans for americans. They use dot for comma there, most parts of the rest of the world do not. Where I live, comma in numbers means comma, while the dot is used for separating thousands in numbers. In the american world it's the opposite. Just look at dates. A date in UBot Studio is on the form MM/DD/YYYY while in my part of the world it's YYYY-MM-DD (which, by the way, makes it a lot easier to sort) .Another thing is the use of the AltGr-key. That didn't work before, now it do after I sent a European keyboard to Eddie so that he could get a grip on how it's used over here. It would be great if UBot was localizeable, it's not. We just have to live with it. If I scrape decimal numbers, I always have to do a string substitute on it to convert the dot into a comma otherwise Javascript won't work. It's just the way it is. (in your case I am uncertain whether it was a comma as in decimal comma, or a comma as in thousand separator that caused the problem) Great that it worked! Quote Link to post Share on other sites
Brutal 164 Posted April 14, 2013 Author Report Share Posted April 14, 2013 Anonym - thanks man, I appreciate you. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.