Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

lib_str.h/lib_str.c

Prototype

Code Block
LanguageC++
CaptionTextCAPTION
languagecpp
          CPU_CHAR  *Str_FmtNbr_Int32U (CPU_INT32U    nbr,
                                        CPU_INT08U    nbr_dig,
                                        CPU_INT08U    nbr_base,
                                        CPU_CHAR      lead_char,
                                        CPU_BOOLEAN   lower_case,
                                        CPU_BOOLEAN   nul,
                                        CPU_CHAR     *pstr);


Arguments

nbr

Number to format into a string.

...

Unprintable character

Format invalid string.

...


lower_case

Option to format any alphabetic characters (if any) in lower case:

...

Character array size must be >= (nbr_dig +
1 NUL terminator)
characters

Example Usage

C++
Code Block
Language
CaptionTextCAPTION
languagecpp
          CPU_CHAR   AppBuf[20];
          CPU_CHAR  *pstr;
 


                  pstr = Str_FmtNbr_Int32U((CPU_INT32U ) 12345678u,
                                   (CPU_INT08U ) 10,
                                   (CPU_INT08U ) 10,
                                   (CPU_CHAR   ) </code>'0'<code >,
                                   (CPU_BOOLEAN) DEF_NO,
                                   (CPU_BOOLEAN) DEF_YES,
                                   (CPU_CHAR  *)&AppBuf[0]);