Try this :
ten_thousand = number/10000;
number = number%10000;
thousand = number/1000;
number = number%1000;
hundred = number/100;
number = number%100;
ten = number/10;
number = number%10;
unit = number;
solved Converting number into word
Try this :
ten_thousand = number/10000;
number = number%10000;
thousand = number/1000;
number = number%1000;
hundred = number/100;
number = number%100;
ten = number/10;
number = number%10;
unit = number;
solved Converting number into word