Before making this topic I read almost all examples and suggestions from this forum. Im just beginner so please dont throw stones on me :-).
I am getting stream via serial to arduino, stream is coming from other arduino as ascii chars. Around 140 chars per request.
I need to round and truncate floats to 2 decimal points then compare with other floats which have 2 decimal precision.
Stream is copied into String first then manipulations are done sorting values.
String a=1.1234567e-02; float B=a.toFloat(); //now is 0.0123456
float c=b*10000.0; int d=(int)c; float e=(float)d/10000.0
So how to get rid of digits after 2 dec point? I.e. Should be 0.01.
I can convert it back to string then truncate digits after 2 dec points and convert back to float. But is there an easy way to do this?