ABL electronic PIC12 Personal Computer User Manual


 
mikroC Conversions Library provides routines for converting numerals to strings,
and routines for BCD/decimal conversions.
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
MikroElektronika:
Development
tools
-
Books
-
Compilers
29 9
page
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
Conversions Library
Library Routines
Prototype
void ByteToStr(unsigned short number, char *output);
Description Function creates an output string out of a small unsigned number (numerical value
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);
// txt is " 24" (one blank here)
ByteToStr