tlx
Loading...
Searching...
No Matches
format_iec_units.hpp
Go to the documentation of this file.
1
/*******************************************************************************
2
* tlx/string/format_iec_units.hpp
3
*
4
* Part of tlx - http://panthema.net/tlx
5
*
6
* Copyright (C) 2016-2017 Timo Bingmann <tb@panthema.net>
7
*
8
* All rights reserved. Published under the Boost Software License, Version 1.0
9
******************************************************************************/
10
11
#ifndef TLX_STRING_FORMAT_IEC_UNITS_HEADER
12
#define TLX_STRING_FORMAT_IEC_UNITS_HEADER
13
14
#include <cstdint>
15
#include <string>
16
17
namespace
tlx
{
18
19
//! \addtogroup tlx_string
20
//! \{
21
22
//! Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of
23
//! two). Returns "123 Ki" or similar.
24
std::string
format_iec_units
(std::uint64_t number,
int
precision = 3);
25
26
//! \}
27
28
}
// namespace tlx
29
30
#endif
// !TLX_STRING_FORMAT_IEC_UNITS_HEADER
31
32
/******************************************************************************/
tlx::format_iec_units
std::string format_iec_units(std::uint64_t number, int precision=3)
Format a byte size using IEC (Ki, Mi, Gi, Ti) suffixes (powers of two).
Definition
format_si_iec_units.cpp:39
tlx
Definition
exclusive_scan.hpp:17
tlx
string
format_iec_units.hpp
Generated on Sat Jul 20 2024 00:00:00 for tlx by
1.12.0