xtd
0.2.0
Loading...
Searching...
No Matches
xtd.core
include
xtd
internal
__currency_formatter.hpp
Go to the documentation of this file.
1
3
#pragma once
5
#if !defined(__XTD_CORE_INTERNAL__)
6
#error "Do not include this file: Internal use only"
7
#endif
9
10
#include "
__binary_formatter.hpp
"
11
12
#include <cmath>
13
#include <iomanip>
14
#include <locale>
15
#include <sstream>
16
18
template
<
class
char
_t>
19
[[nodiscard]]
inline
auto
__currency_formatter(
long
double
value,
const
std::locale& loc) -> std::basic_string<char_t> {
20
std::basic_stringstream<char_t> ss;
21
ss.imbue(loc);
22
ss << std::showbase << std::fixed << std::put_money(value * std::pow(10, std::use_facet<std::moneypunct<char_t >> (loc).frac_digits()));
23
return
ss.str();
24
}
__binary_formatter.hpp
Generated on Wed Feb 11 2026 20:07:05 for xtd by
Gammasoft
. All rights reserved.