mikroC
making it simple...
Conversions Library
mikroC Conversions Library provides routines for converting numerals to strings,
and routines for BCD/decimal conversions.
Library Routines
You can get text representation of numerical value by passing it to one of the fol-
lowing routines:
ByteToStr
ShortToStr
WordToStr
IntToStr
LongToStr
FloatToStr
Following functions convert decimal values to BCD (Binary Coded Decimal) and
vice versa:
Bcd2Dec
Dec2Bcd
Bcd2Dec16
Dec2Bcd16
ByteToStr
Prototype
void ByteToStr(unsigned short number, char *output);
Description
Function creates an
less than 0x100). Output string has fixed width of 3 characters; remaining positions on
the left (if any) are filled with blanks.
Example
unsigned short t = 24;
char *txt;
//...
ByteToStr(t, txt);
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
string out of a small unsigned
output
// txt is " 24" (one blank here)
(numerical value
number
299
page
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?