-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
665b240
commit 42faa9e
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#pragma once | ||
#include "__hexfloat_formatter.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// @file | ||
/// @brief Contains __hexfloat_formatter method. | ||
#pragma once | ||
/// @cond | ||
#if !defined(__XTD_CORE_INTERNAL__) | ||
#error "Do not include this file: Internal use only" | ||
#endif | ||
/// @endcond | ||
|
||
#include <iomanip> | ||
#include <locale> | ||
#include <string> | ||
#include <sstream> | ||
|
||
/// @cond | ||
template<typename char_t> | ||
inline std::basic_string<char_t> __hexfloat_formatter(long double value, int precision, const std::locale& loc) { | ||
std::basic_stringstream<char_t> ss; | ||
ss.imbue(loc); | ||
ss << std::hexfloat << std::setprecision(precision) << value; | ||
return ss.str(); | ||
} | ||
/// @endcond |