Avoiding decimal points

tft.println (RMS*RMS / 8);

How can I avoid the decimal values in the result ?

000.00, I only want to display the digits before the decimal point.
please help

What happens when you do the following?

tft.println((int)(RMS * RMS / 8));

Better still

tft.println ((int)((RMS*RMS / 8) + 0.5));

Or even

tft.println (RMS*RMS / 8, 0);

But neither will give "000"

OP asked for digits before the decimal point, but this was probably the intention indeed.

Yes, ....thank you,
tft.println (RMS*RMS / 8, 0); this line is solved my issue.

thank you. :grinning:

Easy enough to fix with a couple of "if"s

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.