srecord: pretty_size.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
pretty_size.h
Go to the documentation of this file.
1//
2// srecord - Manipulate EPROM load files
3// Copyright (C) 2008, 2010, 2011 Peter Miller
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation; either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this program. If not, see
17// <http://www.gnu.org/licenses/>.
18//
19
20#ifndef SRECORD_PRETTY_SIZE_H
21#define SRECORD_PRETTY_SIZE_H
22
23#include <string>
24
25namespace srecord
26{
27
28/**
29 * The pretty_size function is used to convert a number into a smaller
30 * number with a multiplying suffix (kMGT...).
31 *
32 * @param x
33 * The number to be converted.
34 * @param width
35 * The width of the field you would like to print the number in.
36 * More than six is unnecessary.
37 * @returns
38 * a string, including the suffix.
39 */
40std::string pretty_size(long long x, int width = 0);
41
42};
43
44// vim: set ts=8 sw=4 et :
45#endif // SRECORD_PRETTY_SIZE_H
srecord
Definition adler16.h:25
srecord::pretty_size
std::string pretty_size(long long x, int width=0)
The pretty_size function is used to convert a number into a smaller number with a multiplying suffix ...