cgv
Loading...
Searching...
No Matches
number_format.h
1
#pragma once
2
3
#include <string>
4
5
#include "lib_begin.h"
6
7
namespace
cgv
{
8
namespace
utils {
9
11
class
CGV_API
number_format
{
12
public
:
13
std::string convert(
float
value)
const
;
14
15
void
precision_from_range(
float
first,
float
last);
16
17
unsigned
precision = 0;
18
bool
decimal_integers =
false
;
19
bool
fixed =
true
;
20
bool
trailing_zeros =
true
;
21
int
group_size = 3;
22
std::string group_separator =
","
;
23
bool
grouping =
false
;
24
25
private
:
26
// Can only group integer part without sign
27
std::string apply_grouping(
const
std::string& value)
const
;
28
};
29
30
}
// namesapce utils
31
}
// namesapce cgv
32
33
#include <cgv/config/lib_end.h>
cgv::utils::number_format
A class to store number formatting specification and allow converting numbers to strings.
Definition
number_format.h:11
cgv
this header is dependency free
Definition
print.h:11
cgv
utils
number_format.h
Generated by
1.9.8