How to query a cryptocurrency value?

    I'm trying to look up the value of a cryptocurrency for a little game that would simulate an nft game.

    I can look up the value of a googlesheet, but this one comes as a string and doesn't allow calculations with it (even though I use command to make int/float).

    Would it be possible to add the coingecko api or any other website to check the value?

    Tagged:

    The Ajax plugin will generally allow you to utilize website apis. You can also include JavaScript libraries.

    If you can get a number as a string, you can definitely convert it to an integer or float.

    The Ajax plugin will generally allow you to utilize website apis. You can also include JavaScript libraries.

    If you can get a number as a string, you can definitely convert it to an integer or float.

    $3.98 is the value of 1 unit, in the txt above I should receive the value *2, but 0 came back.

    $3.98 is obtained through a googlesheet with a command to import the value of a cryptocurrency.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads

    Per the manual

    int(x)

    Convert the float or text x to an integer (whole number). If x is text, non-numeric characters are allowed after the number, but not before. For example int("33xx") returns 33, but int("xx33") returns 0.

    Get rid of the $ with replace or tokenat.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)