22#include <rtl/math.hxx>
23#include <com/sun/star/uno/Any.hxx>
24#include <rtl/ustring.hxx>
42 return css::uno::Any( aVal );
52 double operator() (
const css::uno::Any & rAny )
54 double fResult = std::numeric_limits<double>::quiet_NaN();
65 OUString operator() (
const css::uno::Any & rAny )
69 if( std::isnan(*pDouble) )
71 return ::rtl::math::doubleToUString(
73 rtl_math_StringFormat_Automatic,
74 rtl_math_DecimalPlaces_Max,
79 else if(
auto s = o3tl::tryAccess<OUString>(rAny) )
94 double operator() ( std::u16string_view rStr )
96 rtl_math_ConversionStatus eConversionStatus;
97 double fResult = ::rtl::math::stringToDouble( rStr,
'.',
',', & eConversionStatus );
99 if( eConversionStatus != rtl_math_ConversionStatus_Ok )
100 return std::numeric_limits<double>::quiet_NaN();
112 OUString operator() (
double fNumber )
114 return ::rtl::math::doubleToUString(
116 rtl_math_StringFormat_Automatic,
117 rtl_math_DecimalPlaces_Max,
detail::Optional< double >::type tryAccess< double >(css::uno::Any const &any)
unary function to convert css::uno::Any into a double number.
unary function to convert css::uno::Any into an OUString.
unary function to convert a double number into an OUString.
unary function to convert an OUString into a double number.
unary function to convert any type T into a css::uno::Any.
css::uno::Any operator()(const T &aVal)