void myHandler(const char *event, const char *data) { // This is called when the Photon receives the webhook data.
BTClatest = String(data); // Get the latest price of Bitcoin
}
It may not be best but it's working for now which feels better than it not
Have you tried that?
It's a vital step to understand what's happening before being able to answer this
Best print with some means to judge whether there are any non-visible characters embedded.
atof() should work. If it doesn't there's probably something wrong with the incoming data.
And as you know, Strings ...
Why not use char BTClatest[16] and strncpy(BTClatest, data, sizeof(BTClatest) -1)?
However your original issue is probably that you are originally declaring float BTCprice; as a local variable which will vanish as soon you leave the function your global version of it will never be updated.