Hey Guys, i am storing a number as a long in memory and need to convert it to an ascii number ie 123456789 to "123456789" been trying with :
sprintf(telno,"%u",123456789);
but what gets stored in telno is just [49,56,56,51,0,0,0,0,... which is "1883" which seems to be rubbish to me
here the code:
unsigned long xdata Telephone; unsigned char xdata telno[16]; main () { Telephone = 123456789; sprintf(telno,"%u",Telephone); }
thanx in advance
Xarion
GSM itself uses what it calls "semi-octets" - which is effectively just two 4-bit BCD digits packed into each byte (or "octet").
There is also a "type-of-number" field to identify whether it's national, international, etc - without the need to store the '+' or whatever...
If a user is storing a phone number locally, he/she must either store a full international phone number, of make sure to have room to mirror your type-of-number information.