PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Public Member Functions | Public Attributes | List of all members
PropWare::Printer::Format Struct Reference

Passed into any of the Printer::print methods, this struct controls how aspects of numerical printing. More...

#include <PropWare/hmi/output/printer.h>

+ Collaboration diagram for PropWare::Printer::Format:

Public Member Functions

 Format (const uint16_t width=DEFAULT_WIDTH, const char fillChar=DEFAULT_FILL_CHAR, const uint8_t radix=DEFAULT_RADIX, const uint16_t precision=DEFAULT_PRECISION)
 

Public Attributes

uint16_t width
 Minimum number of characters to be printed. More...
 
uint16_t precision
 Number of digits to be printed after the decimal point in a floating point number.
 
uint8_t radix
 Base for the number - usually defaults to 10. Useful for switching between binary, hex and decimal (or any other base you wish)
 
char fillChar
 Character to be printed when a width is provided that is larger than the number. More...
 

Detailed Description

Passed into any of the Printer::print methods, this struct controls how aspects of numerical printing.

Definition at line 87 of file printer.h.

Member Data Documentation

◆ fillChar

char PropWare::Printer::Format::fillChar

Character to be printed when a width is provided that is larger than the number.

If a width of 3 is given but the number "12" is passed in, then a single fillChar will precede 12. This usually ends up looking like "012", but the fill char could be set to a space (or any other character) such that it prints " 12" instead.

Definition at line 111 of file printer.h.

◆ width

uint16_t PropWare::Printer::Format::width

Minimum number of characters to be printed.

If the value to be printed is shorter than this number, the result is padded with the fill char. The value is not truncated even if the result is larger.

Definition at line 94 of file printer.h.


The documentation for this struct was generated from the following file: