| 8 | namespace 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, |