Code for the class CTimer.
More...
#include <sstream>
#include <cmath>
#include "Timer.h"
#include <time.h>
◆ AppendCommaSeparator()
void AppendCommaSeparator |
( |
std::string & |
s | ) |
|
Append a comma and a space to a string provided it is non-empty.
- Parameters
-
s | [in, out] String to append to. |
◆ to_string()
const std::string to_string |
( |
const float |
x, |
|
|
const size_t |
n |
|
) |
| |
Convert float to a fixed-precision string without trailing zeros. Unfortunately, std::to_string
does not have a way to limit precision, so we'll have to get creative with std::ostringstream
instead.
- Parameters
-
x | Floating point number |
n | Maximum number of digits after the decimal. |
- Returns
- Fixed-precision string with no trailing zeros.