v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
Sifteo::FixedFP Struct Reference

Format a floating point number using fixed precision. More...

#include <sifteo/string.h>

Public Member Functions

 FixedFP (float value, unsigned left, unsigned right, bool leadingZeroes=false)
 Format 'value' using exactly 'left' digits to the left of the decimal, and 'right' digits to the right. More...
 

Detailed Description

Format a floating point number using fixed precision.

This is a type which can be used with String's << operator, to format floating point numbers with a fixed number of digits to the left and to the right of the decimal point.

Note that this operates by converting both the left and right side into integers, and printing them separately.

Constructor & Destructor Documentation

Sifteo::FixedFP::FixedFP ( float  value,
unsigned  left,
unsigned  right,
bool  leadingZeroes = false 
)
inline

Format 'value' using exactly 'left' digits to the left of the decimal, and 'right' digits to the right.

If 'leadingZeroes', extra leading characters will be '0', otherwise they will be spaces.


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