| 504 | // format a number according to the give formatting type |
| 505 | template<typename T> |
| 506 | static inline std::string format_number(T num, NumberFormatType type) { |
| 507 | std::ostringstream ss; |
| 508 | imbue_with_locale(ss, type); |
| 509 | switch (type) { |
| 510 | case NumberFormatType::SCIENTIFIC: |
| 511 | ss << (double)num; |
| 512 | break; |
| 513 | case NumberFormatType::SIG_FIG: |
| 514 | ss << format_number_by_sig_fig(num, 3); |
| 515 | break; |
| 516 | default: |
| 517 | ss << num; |
| 518 | break; |
| 519 | } |
| 520 | return ss.str(); |
| 521 | } |
| 522 | |
| 523 | template<typename T> |
| 524 | static inline std::string format_number(T num) { |
no test coverage detected