summaryrefslogtreecommitdiff
path: root/zen/format_unit.h
blob: 1c96da51ec7a1b786cae6f2000239f30170ee5ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// *****************************************************************************
// * This file is part of the FreeFileSync project. It is distributed under    *
// * GNU General Public License: https://www.gnu.org/licenses/gpl-3.0          *
// * Copyright (C) Zenju (zenju AT freefilesync DOT org) - All Rights Reserved *
// *****************************************************************************

#ifndef FMT_UNIT_8702184019487324
#define FMT_UNIT_8702184019487324

#include <string>
#include <cstdint>
#include "string_tools.h"


namespace zen
{
std::wstring formatFilesizeShort(int64_t filesize);
std::wstring formatRemainingTime(double timeInSec);
std::wstring formatFraction(double fraction); //within [0, 1]
std::wstring formatUtcToLocalTime(time_t utcTime); //like Windows Explorer would...

std::wstring formatTwoDigitPrecision  (double value); //format with fixed number of digits
std::wstring formatThreeDigitPrecision(double value); //(unless value is too large)

std::wstring formatNumber(int64_t n); //format integer number including thousands separator



enum class WeekDay
{
    monday,
    tuesday,
    wednesday,
    thursday,
    friday,
    saturday,
    sunday,
};
WeekDay getFirstDayOfWeek();

namespace impl { WeekDay getFirstDayOfWeekImpl(); } //throw SysError
}

#endif
bgstack15