nRF5 SDK  v17.0.2
Choose documentation:
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
fprintf library

This library writes a C string pointed by format to a defined output. It works like a standard fprintf C function with some limitations.

Supported format specifiers:

  • d -> Signed decimal integer.
  • i -> Signed decimal integer.
  • u -> Unsigned decimal integer.
  • x -> Unsigned hexadecimal integer uppercase .
  • X -> Unsigned hexadecimal integer uppercase.
  • f -> Floating-point number in fixed point notation, lowercase (up to 10 precision).
  • F -> Floating-point number in fixed point notation, uppercase (up to 10 precision).
  • c -> Character.
  • s -> String of characters.
  • p -> Pointer address.
  • % -> Two following % will result in single % sent to the stream.
  • * -> Variable field width size - it shall be used together with the above format specifiers, for example: "%*s".

Supported format flags:

  • - -> Left justification.
  • 0 -> Left-pads the number with zeroes.
  • + -> Forces to display the result with a plus or minus sign.