summaryrefslogtreecommitdiff
path: root/zen/format_unit.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:28:01 +0200
commitfe9eb89ebc1b3c33cbac00a3fa095a14faef9113 (patch)
tree8a3bb620a9acb83fe0057061a86e8f2cb91a9fe1 /zen/format_unit.cpp
parent5.21 (diff)
downloadFreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.gz
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.tar.bz2
FreeFileSync-fe9eb89ebc1b3c33cbac00a3fa095a14faef9113.zip
5.22
Diffstat (limited to 'zen/format_unit.cpp')
-rw-r--r--zen/format_unit.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/zen/format_unit.cpp b/zen/format_unit.cpp
index 4f16e3e1..4b39d5a9 100644
--- a/zen/format_unit.cpp
+++ b/zen/format_unit.cpp
@@ -40,7 +40,7 @@ std::wstring zen::filesizeToShortString(Int64 size)
//if (size < 0) return _("Error"); -> really?
if (numeric::abs(size) <= 999)
- return replaceCpy(_P("1 byte", "%x bytes", to<int>(size)), L"%x", numberTo<std::wstring>(size));
+ return _P("1 byte", "%x bytes", to<int>(size));
double sizeInUnit = to<double>(size);
auto formatUnit = [&](const std::wstring& unitTxt) { return replaceCpy(unitTxt, L"%x", formatThreeDigitPrecision(sizeInUnit)); };
@@ -79,17 +79,16 @@ enum UnitRemTime
std::wstring formatUnitTime(int val, UnitRemTime unit)
{
- auto subst = [&](const std::wstring& output) { return replaceCpy(output, L"%x", zen::numberTo<std::wstring>(val)); };
switch (unit)
{
case URT_SEC:
- return subst(_P("1 sec", "%x sec", val));
+ return _P("1 sec", "%x sec", val);
case URT_MIN:
- return subst(_P("1 min", "%x min", val));
+ return _P("1 min", "%x min", val);
case URT_HOUR:
- return subst(_P("1 hour", "%x hours", val));
+ return _P("1 hour", "%x hours", val);
case URT_DAY:
- return subst(_P("1 day", "%x days", val));
+ return _P("1 day", "%x days", val);
}
assert(false);
return _("Error");
@@ -256,8 +255,8 @@ std::wstring zen::ffs_Impl::includeNumberSeparator(const std::wstring& number)
const lconv* localInfo = ::localeconv(); //always bound according to doc
const std::wstring& thousandSep = utfCvrtTo<std::wstring>(localInfo->thousands_sep);
- // THOUSANDS_SEPARATOR = std::use_facet<std::numpunct<wchar_t> >(std::locale("")).thousands_sep(); - why not working?
- // DECIMAL_POINT = std::use_facet<std::numpunct<wchar_t> >(std::locale("")).decimal_point();
+ // THOUSANDS_SEPARATOR = std::use_facet<std::numpunct<wchar_t>>(std::locale("")).thousands_sep(); - why not working?
+ // DECIMAL_POINT = std::use_facet<std::numpunct<wchar_t>>(std::locale("")).decimal_point();
std::wstring output(number);
size_t i = output.size();
bgstack15