11
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 switch to a string
and use the substring(), but would like something without having to convert to string
and then have to change again to int
.
Multiplying by 0.1?
– user28595
@Articuno and making cast for whole back
– Jefferson Quesado