Jump to content

Trunc()

From OpenBOR

Accepts a decimal value and returns its integer portion by discarding all digits after the decimal point. Truncation proceeds toward zero using the C trunc() function.

float input = 3.8;

int result = trunc(input);

// result = 3