integral only

hi..i just wanna ask..how can extract integral part and the fractional part....can you guys give me example..ty :)

The integer part is easiest, with an assignment. Then subtract that value from the original floating point value.

can you give example for reference only.. :)

void setup()
{
  Serial.begin(115200);
  float theFloat = 123.456;
  int theIntegerPart = theFloat;
  Serial.println(theIntegerPart);
  float theFractionalPart = theFloat - theIntegerPart;
  Serial.println(theFractionalPart, 3);
}

void loop()
{
}

OP was obviously happy with that - or didn’t understand a word!

lastchancename: OP was obviously happy with that - or didn’t understand a word!

Perhaps I should have used more descriptive names for the variables :)

what does floating have to do with indegers? :)

lastchancename: what does floating have to do with indegers? :)

Whatever floats your boat... 8)