Intermiediary commit.
This commit is contained in:
@@ -815,6 +815,26 @@ std::string LLStringOps::getDatetimeCode (std::string key)
|
||||
}
|
||||
|
||||
|
||||
std::string LLStringOps::getReadableNumber(F64 num)
|
||||
{
|
||||
if (fabs(num)>=1e9)
|
||||
{
|
||||
return llformat("%.2lfB", num / 1e9);
|
||||
}
|
||||
else if (fabs(num)>=1e6)
|
||||
{
|
||||
return llformat("%.2lfM", num / 1e6);
|
||||
}
|
||||
else if (fabs(num)>=1e3)
|
||||
{
|
||||
return llformat("%.2lfK", num / 1e3);
|
||||
}
|
||||
else
|
||||
{
|
||||
return llformat("%.2lf", num);
|
||||
}
|
||||
}
|
||||
|
||||
namespace LLStringFn
|
||||
{
|
||||
// NOTE - this restricts output to ascii
|
||||
|
||||
Reference in New Issue
Block a user