Chat freely about anything...

User avatar
By Diyhouse
#31271 OK,.. I am clearly doing something wrong,.. as all the docs say "it should work"... but what ever examples I try from various sources,.. fail in one way or another.

    a = 22/7
    print(string.format("%.2f", a))

What have I miss-understood... how do I set a number to be a float,.. the docs infer I just use it with decimal places.... Am I just trying to print float number incorrectly?...

Tx Guys
User avatar
By Diyhouse
#31497 Yes that's the little gotcha I fell for... Many thanks for pointing that out...

For those interested,.. I download the two latest integer and float versions from:-

https://github.com/nodemcu/nodemcu-firmware/releases

And once downloaded use the nodeMCU flasher and under the config tab select the downloaded binary to be flashed.