> It depends. Are there always going to be four digits
> before the decimal? If so, you can do this.
> double aa = yourDouble / 100;
> double bbccc = yourDouble % 100;
Thats a pretty clever solution. Won't double add a load more number on the end like 1234324 though?
> Thats a pretty clever solution. Won't double add a
> load more number on the end like 1234324 though?
I have the same fear. Would it make sense to multiply first by 1000 convert to an int, and then do the divide and mod:
double yourDouble = aabb.ccc;
int myInt = (int)(1000 * yourDouble);
int aa = myInt / 100000;
int bbccc = myInt % 100000;
or what about just using decimals?
Message was edited by:
petes1234