summaryrefslogtreecommitdiff
path: root/zen/format_unit.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-02-06 16:41:53 -0500
committerB. Stack <bgstack15@gmail.com>2022-02-06 16:41:53 -0500
commitf6b6d222dc1a79c95f6756c707c5fcc3a785c030 (patch)
tree374c62790fde0ce5514ef56750d0ff023d61b528 /zen/format_unit.cpp
parentadd upstream 11.16 (diff)
downloadFreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.tar.gz
FreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.tar.bz2
FreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.zip
add upstream 11.17
Diffstat (limited to 'zen/format_unit.cpp')
-rw-r--r--zen/format_unit.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/zen/format_unit.cpp b/zen/format_unit.cpp
index d546124f..6803523a 100644
--- a/zen/format_unit.cpp
+++ b/zen/format_unit.cpp
@@ -90,14 +90,12 @@ std::wstring formatUnitTime(int val, UnitRemTime unit)
{
switch (unit)
{
- case UnitRemTime::sec:
- return _P("1 sec", "%x sec", val);
- case UnitRemTime::min:
- return _P("1 min", "%x min", val);
- case UnitRemTime::hour:
- return _P("1 hour", "%x hours", val);
- case UnitRemTime::day:
- return _P("1 day", "%x days", val);
+ //*INDENT-OFF*
+ case UnitRemTime::sec: return _P("1 sec", "%x sec", val);
+ case UnitRemTime::min: return _P("1 min", "%x min", val);
+ case UnitRemTime::hour: return _P("1 hour", "%x hours", val);
+ case UnitRemTime::day: return _P("1 day", "%x days", val);
+ //*INDENT-ON*
}
assert(false);
return _("Error");
@@ -152,15 +150,10 @@ std::wstring zen::formatRemainingTime(double timeInSec)
}
-//std::wstring zen::fractionToString1Dec(double fraction)
-//{
-// return printNumber<std::wstring>(L"%.1f", fraction * 100.0) + L'%'; //no need to internationalize fraction!?
-//}
-
-
-std::wstring zen::formatFraction(double fraction)
+std::wstring zen::formatPercent0(double fraction)
{
- return printNumber<std::wstring>(L"%.2f", fraction * 100.0) + L'%'; //no need to internationalize fraction!?
+ return numberTo<std::wstring>(std::lround(fraction * 100)) + L'%'; //need to localize percent!?
+ //return printNumber<std::wstring>(L"%.2f", fraction * 100) + L'%';
}
@@ -193,7 +186,6 @@ WeekDay impl::getFirstDayOfWeekImpl() //throw SysError
---------------------------------------
LC_TIME=en_DK.utf8 => Monday
LC_TIME=en_US.utf8 => Sunday */
-
const char* firstDay = ::nl_langinfo(_NL_TIME_FIRST_WEEKDAY); //[1-Sunday, 7-Saturday]
ASSERT_SYSERROR(firstDay && 1 <= *firstDay && *firstDay <= 7);
bgstack15