Frank 177 Posted April 3, 2010 Report Share Posted April 3, 2010 How do I change a number that is like, 1.34594940 and strip off the decimal portion and just display the whole number? Frank Quote Link to post Share on other sites
Aaron Nimocks 19 Posted April 3, 2010 Report Share Posted April 3, 2010 Got 2 examples in here. One if you want just the whole number and the other if you wanted it to round up.wholenumber.ubot Quote Link to post Share on other sites
Frank 177 Posted April 3, 2010 Author Report Share Posted April 3, 2010 Thanks very much Aaron! I've never seen these commands before. Where do I find these commands from the right click pick lists? Don't seem to see them in there. And is there a math command that will return a fixed decimal number? For example, 34.7669400543 would become 34.77 when I request a 2 decimal place number? Also, is there a reference showing all the ubot commands by chance? Frank Quote Link to post Share on other sites
Aaron Nimocks 19 Posted April 3, 2010 Report Share Posted April 3, 2010 This is just javascript. Here is a list of math functions you can use similar to the way I did it. http://www.javascripter.net/faq/mathfunc.htm Quote Link to post Share on other sites
Frank 177 Posted April 3, 2010 Author Report Share Posted April 3, 2010 ya so sneaky. I never, ever thought of using the power of javascript! Man, that opens up a whole big can of whipa**! Would be very cool to be able to create local javascript functions and call them within the script. Frank Quote Link to post Share on other sites
Frank 177 Posted April 3, 2010 Author Report Share Posted April 3, 2010 Aaron, You realize that you've opened pandora's box, ok? With the power of javascript ubot goes from being really cool to being uber cool! Been testing building some javascript functions early in the javascript code and pulling them later works VERY WELL!!!! Can you see the possibilities? Thanks again Aaron! Frank Quote Link to post Share on other sites
Aaron Nimocks 19 Posted April 3, 2010 Report Share Posted April 3, 2010 Ya it truly does make a difference. It's too bad I dont really do javascript so I cant really take advantage of it to its full potential. Quote Link to post Share on other sites
Frank 177 Posted April 3, 2010 Author Report Share Posted April 3, 2010 Currently trying to convince the support guys to let us turn off the top section in ubot and drive ubot with a builtin web page! Very exciting. Frank Quote Link to post Share on other sites
UBotBuddy 331 Posted May 19, 2010 Report Share Posted May 19, 2010 Aaron/Frank, Hmmmm...I tried the Aaron's ubot code he put in here but it only shows the Number. It does not seem to process the Whole number or the Rounded Number. Any ideas? Quote Link to post Share on other sites
Frank 177 Posted May 22, 2010 Author Report Share Posted May 22, 2010 Aaron/Frank, Hmmmm...I tried the Aaron's ubot code he put in here but it only shows the Number. It does not seem to process the Whole number or the Rounded Number. Any ideas? Yes, since ubot has no way to explicitly declare a string or a number to a variable, if you have a very hard to detect 'space' before or after the number, it will be automatically considered a string variable. Frank 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.