How to avoid auto round off

Hi

I have a below expression.
Convert.ToChar(Convert.ToInt32(65+((columnNumber/26)-1))).

When columnNumber = 66, columnNumber/26=2.53. So it automatically makes it 3. But I want 2. So how can i avoid the round off and get 2 instead of 3.

Use Math.Floor to round down the value.

Math.Floor(columnNumber/26) result value is 2

Regards,
Karthik Byggari

4 Likes

Thank you @KarthikByggari.

1 Like

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