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 {
7namespace logger {
8namespace commons {
9
10const std::string indent_0 = "\t\t";
11const std::string indent_1 = "\t";
12
13inline double convert_in_million_euros(double val) { return val / 1e6; }
14
15inline std::string create_str_million_euros(double val) {
16 std::stringstream result;
17 result << std::fixed << std::setprecision(2) << convert_in_million_euros(val);
18 return result.str();
19}
20
21inline std::string create_str_euros(double val) {
22 std::stringstream result;
23 result << std::scientific << std::setprecision(5) << val;
24 return result.str();
25}
26
27inline std::string create_str_mw(double val) {
28 std::stringstream result;
29 result << std::fixed << std::setprecision(0) << val;
30 return result.str();
31}
32} // namespace commons
33} // namespace logger
34} // namespace xpansion
35#endif // ANTARESXPANSION_COMMONS_H