Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
Commons.h
1#ifndef ANTARESXPANSION_COMMONS_H
2#define ANTARESXPANSION_COMMONS_H
3#include <iomanip>
4#include <sstream>
5
6namespace xpansion
7{
8namespace logger
9{
10namespace commons
11{
12
13const std::string indent_0 = "\t\t";
14const std::string indent_1 = "\t";
15
16inline double convert_in_million_euros(double val)
17{
18 return val / 1e6;
19}
20
21inline std::string create_str_million_euros(double val)
22{
23 std::stringstream result;
24 result << std::fixed << std::setprecision(2) << convert_in_million_euros(val);
25 return result.str();
26}
27
28inline std::string create_str_euros(double val)
29{
30 std::stringstream result;
31 result << std::scientific << std::setprecision(5) << val;
32 return result.str();
33}
34
35inline std::string create_str_mw(double val)
36{
37 std::stringstream result;
38 result << std::fixed << std::setprecision(0) << val;
39 return result.str();
40}
41} // namespace commons
42} // namespace logger
43} // namespace xpansion
44#endif // ANTARESXPANSION_COMMONS_H