Fix formatting of bytes transferred
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
class Utility
|
||||
{
|
||||
public:
|
||||
static String formatNumber(size_t number,bool commas=true);
|
||||
static String formatNumber(long number,bool commas=true);
|
||||
static String formatNumber(double number,bool commas=true);
|
||||
static String formatNumber(double number,int places=2);
|
||||
@@ -59,6 +60,15 @@ String Utility::bytesTransferredToString(double bytesTransferred)
|
||||
return Utility::formatNumber(roundedValue,2) + "B/s";
|
||||
}
|
||||
|
||||
inline
|
||||
String Utility::formatNumber(size_t number, bool commas)
|
||||
{
|
||||
String formattedString;
|
||||
String format="%lu";
|
||||
::sprintf(formattedString.str(),format,number);
|
||||
return addCommas(formattedString);
|
||||
}
|
||||
|
||||
inline
|
||||
String Utility::formatNumber(long number,bool commas)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user