How can I remove the last number from an integer?
Ex:
int value = 123456789;
int newValue = 12345678;
Note that the new value does not have 9.
I know it would be possible to change to a string
and use the substring (), but I would like something without having to convert to string
and then have to change back to int
.