MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Convert

Method Convert

FastCopy/DoubleToStringConverter.cpp:10–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace winrt::FastCopy::implementation
9{
10 winrt::Windows::Foundation::IInspectable DoubleToStringConverter::Convert(
11 winrt::Windows::Foundation::IInspectable const& value,
12 winrt::Windows::UI::Xaml::Interop::TypeName const& targetType,
13 winrt::Windows::Foundation::IInspectable const& parameter,
14 winrt::hstring const& language)
15 {
16 auto const doubleValue = winrt::unbox_value<double>(value);
17 auto const numDigits = std::stoi(winrt::unbox_value_or<winrt::hstring>(parameter, L"0").data());
18 std::wstringstream ss;
19 ss << std::fixed << std::setprecision(numDigits) << doubleValue;
20 return winrt::box_value(ss.str());
21 }
22
23 winrt::Windows::Foundation::IInspectable DoubleToStringConverter::ConvertBack(
24 winrt::Windows::Foundation::IInspectable const& value,

Callers

nothing calls this directly

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected