• Resolved digitaled

    (@digitaled)


    Hi I made this calculate page for working with crypto currency it is working very well but I can not add more to it and get that working.

    https://dealsbranson.com/

    I want to take the cost of the coin you want to buy and then – a set amount from another field I had to remove and then times that by the Here is the amount of coins you can buy with your investment money field. Should be very simple

    I have set this up and no matter what I do it adds it up wrong. I had to take it down as that part did not work.

    Example If the cost of the coin is $1.79 with a buy in of $1000 that gives me 558.659217877095 coins it shows for that $1000.
    Now if I want to see how much money I would lose if it sold at a loss ( called a Stop Loss ) for $1.50 this would be

    $1.79 coin cost field – $1.50 coin loss field I had to remove = $0.29 Times Total of coins I can buy field 558.659217877095 should be around $162 I would lose if it sold for $1.50 at a Stop loss

    But in the plugin when I put all this in I get some crazy -800 plus number that is just way off. It does not calculate the numbers right. I can do it with a calculator very easy but can not get the plugin to do it.

    How can I fix this?

    Also, I would like to be able to use %s so I can set a cost % for buying and selling fees I could not figure out how to do that.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter digitaled

    (@digitaled)

    I added it back in so you see what it is doing

    fieldname21-fieldname30*fieldname4 should not be -836.1988268156425 with the numbers from the first post

    Thread Starter digitaled

    (@digitaled)

    fieldname21 is = Enter in the cost of the coin you want to buy

    fieldname30 is = Stop loss price to test – not working do not use yet

    fieldname4 is = Here is the amount of coins you can buy with your investment money

    Plugin Author codepeople

    (@codepeople)

    Hello,

    The order of operations is important in mathematics, for example:

    A-B*C will solve first B*C, and the result will be subtracted from A, in your case:

    1.79-1.5*558.659217877095 = 1.79-837.9888268156425 = -836.1988268156425

    To modify the order of the operators are used the parentheses:

    (A-B)*C will solve first A-B, and the result will be multiplied with C, in your case:

    (1.79-1.5)*558.659217877095 = (0.29)*558.659217877095 = 162.01117318435755

    Please, modifies the equation: fieldname21-fieldname30*fieldname4 as follows:

    (fieldname21-fieldname30)*fieldname4

    Best regards.

    Thread Starter digitaled

    (@digitaled)

    Thank you very much, it is working now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Not calculate numbers right’ is closed to new replies.