Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
bebbec17
Commit
bebbec17
authored
Apr 24, 2020
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0dccb7d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
TextFunctions.h
utils/TextFunctions.h
+11
-5
No files found.
utils/TextFunctions.h
View file @
bebbec17
...
...
@@ -7,7 +7,7 @@
#include <string>
#include <map>
#include <list>
#include
"stdio.h"
#include
<stdio.h>
#include <iomanip>
#include "Converter.h"
#include "MException.h"
...
...
@@ -15,21 +15,27 @@
#define SPACES " \t\r\n"
static
std
::
string
ToStr
(
int
arg
)
static
std
::
string
ToStr
(
const
int
arg
,
const
int
leading_zeros
=
0
)
{
std
::
ostringstream
ss
;
if
(
leading_zeros
)
{
ss
<<
std
::
setw
(
leading_zeros
)
<<
std
::
setfill
(
'0'
);
}
ss
<<
arg
;
return
ss
.
str
();
}
static
std
::
string
ToStr
(
size_t
arg
)
static
std
::
string
ToStr
(
const
size_t
arg
,
const
int
leading_zeros
=
0
)
{
std
::
ostringstream
ss
;
if
(
leading_zeros
)
{
ss
<<
std
::
setw
(
leading_zeros
)
<<
std
::
setfill
(
'0'
);
}
ss
<<
arg
;
return
ss
.
str
();
}
static
std
::
string
ToStr
(
double
arg
)
static
std
::
string
ToStr
(
const
double
arg
)
{
std
::
ostringstream
ss
;
ss
<<
arg
;
...
...
@@ -37,7 +43,7 @@ static std::string ToStr(double arg)
}
static
std
::
string
ToStr
(
double
value
,
int
precision
)
static
std
::
string
ToStr
(
const
double
value
,
const
int
precision
)
{
std
::
ostringstream
ss
;
ss
<<
std
::
setprecision
(
precision
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment