Jump to content
UBot Underground

Recommended Posts

Hello, i am working on a cryptocurrency trading calculator, and because the tradings are based on bitcoin it has to manipulate 8 decimal numbers ex: 0.00000222

The problem is that when the bot is doing some math calculations it converts this numbers to exponential numbers and then does not recognize them as numbers anymore but as strings. How can i stop the bot transform the numbers from decimal to exponential ex:

0.00000222 to 2.22E-06

Link to post
Share on other sites

Hi,

 

Not sure how you are using your calculations but you can try and use Python/Ironpython as they are a scientific calculator too.

 

Regards,

 

CD

 

 

Unfortunately i don't know python...

Link to post
Share on other sites
  • 3 weeks later...

I've encountered same issue when building free bitcoin bot and I've found the solution by using javascript toFixed() method

 

here is example:

set(#current bet,0.00000001,"Global")
set(#current bet,$eval("{#current bet}*2"),"Global")
set(#current bet,$eval("var x={#current bet}; x=x.toFixed(8); x;"),"Global")

have fun!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...