mirror of
https://github.com/znc/znc.git
synced 2026-05-02 19:42:32 +02:00
CString now takes a precision for converting floating point numbers
Because the precision defaults to 2, e.g. the traffic stats are now way more readable. Thanks to KiNgMaR for the idea and the patch. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1525 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -139,8 +139,8 @@ CString::CString(long i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(unsigned long i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(long long i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(unsigned long long i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(double i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(float i) : string() { stringstream s; s << i; *this = s.str(); }
|
||||
CString::CString(double i, int precision) : string() { stringstream s; s.precision(precision); s << std::fixed << i; *this = s.str(); }
|
||||
CString::CString(float i, int precision) : string() { stringstream s; s.precision(precision); s << std::fixed << i; *this = s.str(); }
|
||||
|
||||
inline unsigned char* CString::strnchr(const unsigned char* src, unsigned char c, unsigned int iMaxBytes, unsigned char* pFill, unsigned int* piCount) const {
|
||||
for (unsigned int a = 0; a < iMaxBytes && *src; a++, src++) {
|
||||
|
||||
Reference in New Issue
Block a user