Jump to content
UBot Underground

How to convert number


Recommended Posts

I have a site where i should input BTC like this: 0.00000100   (8 decimals) in form i want to enter 100 only. How to convert so i get comma right? If i take 100 * 100000000 it gives a sience number in debugger. I cant use that. How to do?

Thanks for help

Link to post
Share on other sites

Here is some example code how it can be done:

plugin command("Data and Files Automation.dll", "Data and Files Automation Set License", "YOUR-LICENSE-KEY")
ui text box("Input Small Amount",#input_number)
ui stat monitor("Output: ",#output_number)
ui button("Convert if less than 1 BTC") {
    set(#output_number,#input_number,"Global")
    set(#count_characters,$plugin function("Data and Files Automation.dll", "$char count", #input_number, "False"),"Global")
    if($comparison(#count_characters,"< Less than",9)) {
        then {
            set(#how_many_zeros_to_add,$subtract(8,#count_characters),"Global")
            loop(#how_many_zeros_to_add) {
                set(#output_number,"0{#output_number}","Global")
            }
            set(#output_number,"0.{#output_number}","Global")
        }
        else {
        }
    }
    if($comparison(#count_characters,"> Greater than",8)) {
        then {
            alert("Attention. You have entered a large amount! Will set number to 0 for your safety.")
            set(#output_number,0,"Global")
        }
        else {
        }
    }
    plugin command("Data and Files Automation.dll", "set clipboard", #output_number, "Text")
    alert("Result: {#output_number}
Copied to Clipboard!")
}

-----------------------------------

This script needs the Data & Files Automation Plugin to work (free starter version available): https://automaxed.com/plugins/data-and-files-automation

Convert Small Numbers to 8 Decimal BTC Amount

In the video the input 12345678 doesn't get converted to 0.12345678 - it is fixed already by now in the code above. Just didn't want to record another video after the correction 😄

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...