Soldered SD Card Arduino Library 1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
FmtNumber.cpp File Reference

Functions

char * fmtBase10 (char *str, uint16_t n)
 
char * fmtBase10 (char *str, uint32_t n)
 
char * fmtHex (char *str, uint32_t n)
 
char * fmtSigned (char *str, int32_t num, uint8_t base, bool caps)
 
char * fmtUnsigned (char *str, uint32_t num, uint8_t base, bool caps)
 
char * fmtDouble (char *str, double num, uint8_t prec, bool altFmt)
 
char * fmtDouble (char *str, double value, uint8_t prec, bool altFmt, char expChar)
 
float scale10 (float v, int8_t n)
 
float scanFloat (const char *str, const char **ptr)
 

Variables

static const double powTen [] = {1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9}
 
static const double rnd [] = {5e-1, 5e-2, 5e-3, 5e-4, 5e-5, 5e-6, 5e-7, 5e-8, 5e-9, 5e-10}
 
static const size_t MAX_PREC = sizeof(powTen) / sizeof(powTen[0])
 
static const float m[] PROGMEM = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32}
 
static const float m [] = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32}
 
static const float p [] = {1e+1, 1e+2, 1e+4, 1e+8, 1e+16, 1e+32}
 

Function Documentation

◆ fmtBase10() [1/2]

char * fmtBase10 ( char *  str,
uint16_t  n 
)

◆ fmtBase10() [2/2]

char * fmtBase10 ( char *  str,
uint32_t  n 
)

◆ fmtDouble() [1/2]

char * fmtDouble ( char *  str,
double  num,
uint8_t  prec,
bool  altFmt 
)

◆ fmtDouble() [2/2]

char * fmtDouble ( char *  str,
double  value,
uint8_t  prec,
bool  altFmt,
char  expChar 
)

Print a number followed by a field terminator.

Parameters
[in]valueThe number to be printed.
[in]ptrPointer to last char in buffer.
[in]precNumber of digits after decimal point.
[in]expCharUse exp format if non zero.
Returns
Pointer to first character of result.

◆ fmtHex()

char * fmtHex ( char *  str,
uint32_t  n 
)

◆ fmtSigned()

char * fmtSigned ( char *  str,
int32_t  num,
uint8_t  base,
bool  caps 
)

◆ fmtUnsigned()

char * fmtUnsigned ( char *  str,
uint32_t  num,
uint8_t  base,
bool  caps 
)

◆ scale10()

float scale10 ( float  v,
int8_t  n 
)

◆ scanFloat()

float scanFloat ( const char *  str,
const char **  ptr 
)

Variable Documentation

◆ m

const float m[] = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32}
static

◆ MAX_PREC

const size_t MAX_PREC = sizeof(powTen) / sizeof(powTen[0])
static

◆ p

static const float p = {1e+1, 1e+2, 1e+4, 1e+8, 1e+16, 1e+32}
static

◆ powTen

const double powTen[] = {1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9}
static

◆ PROGMEM

const float p [] PROGMEM = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32}
static

◆ rnd

const double rnd[] = {5e-1, 5e-2, 5e-3, 5e-4, 5e-5, 5e-6, 5e-7, 5e-8, 5e-9, 5e-10}
static