20#include <rtl/math.hxx>
33#include <config_features.h>
64 nRes =
static_cast<double>(
p->nLong);
67 nRes =
static_cast<double>(
p->nULong);
80 nRes =
static_cast< double >(
p->nInt64);
87 if (!
p->pDecimal || !
p->pDecimal->getDouble(nRes))
93#if HAVE_FEATURE_SCRIPTING
101 std::shared_ptr<SvNumberFormatter> pFormatter;
113 sal_Int32 nCheckPos = 0;
114 SvNumFormatType nType = SvNumFormatType::DEFINED | SvNumFormatType::DATE | SvNumFormatType::TIME | SvNumFormatType::CURRENCY
115 | SvNumFormatType::NUMBER | SvNumFormatType::SCIENTIFIC | SvNumFormatType::FRACTION;
131 case DateOrder::MDY: aDateStr =
"MM/DD/YYYY";
break;
132 case DateOrder::DMY: aDateStr =
"DD/MM/YYYY";
break;
133 case DateOrder::YMD: aDateStr =
"YYYY/MM/DD";
break;
136 OUString
aStr = aDateStr +
" HH:MM:SS";
138 pFormatter->PutandConvertEntry(
aStr, nCheckPos,
nType,
140 bool bSuccess = pFormatter->IsNumberFormat( *
p->pOUString,
nIndex, nRes );
144 if(!(nType_ & ( SvNumFormatType::DATETIME | SvNumFormatType::DATE |
145 SvNumFormatType::TIME | SvNumFormatType::DEFINED )))
161 pVal =
dynamic_cast<SbxValue*
>(
p->pObj );
202 nRes =
static_cast< double >(*
p->pnInt64);
274#if HAVE_FEATURE_SCRIPTING
277 p->pOUString =
new OUString;
282 std::shared_ptr<SvNumberFormatter> pFormatter;
294 sal_Int32 nCheckPos = 0;
301 if( n <= -1.0 || n >= 1.0 )
304 if( rtl::math::approxEqual(floor(
n ),
n) )
309 case DateOrder::MDY:
aStr =
"MM/DD/YYYY";
break;
310 case DateOrder::DMY:
aStr =
"DD/MM/YYYY";
break;
311 case DateOrder::YMD:
aStr =
"YYYY/MM/DD";
break;
319 case DateOrder::MDY:
aStr =
"MM/DD/YYYY HH:MM:SS";
break;
320 case DateOrder::DMY:
aStr =
"DD/MM/YYYY HH:MM:SS";
break;
321 case DateOrder::YMD:
aStr =
"YYYY/MM/DD HH:MM:SS";
break;
329 pFormatter->PutandConvertEntry(
aStr,
335 pFormatter->GetOutputString(
n,
nIndex, *
p->pOUString, &pColor );
340 pVal =
dynamic_cast<SbxValue*
>(
p->pObj );
379 *
p->pSingle =
static_cast<float>(
n);
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
LanguageType getLanguageType(bool bResolveSystem=true) const
DateOrder getDateOrder() const
static std::shared_ptr< SvNumberFormatter > PrepareNumberFormatter(sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx, LanguageType const *peFormatterLangType=nullptr, DateOrder const *peFormatterDateOrder=nullptr)
std::shared_ptr< SvNumberFormatter > const & GetNumberFormatter()
static void SetError(ErrCode)
bool setDouble(double val)
const LocaleDataWrapper & GetLocaleData() const
#define LANGUAGE_ENGLISH_US
#define ERRCODE_BASIC_NO_OBJECT
#define ERRCODE_BASIC_MATH_OVERFLOW
#define ERRCODE_BASIC_CONVERSION
double ImpCurrencyToDouble(const sal_Int64 r)
auto ImpDoubleToChar(double f)
auto ImpDoubleToInteger(double f)
auto ImpDoubleToSalUInt64(double d)
auto ImpDoubleToLong(double f)
auto ImpDoubleToUShort(double f)
auto ImpDoubleToULong(double f)
double ImpSalUInt64ToDouble(sal_uInt64 n)
sal_Int64 ImpDoubleToCurrency(double d)
auto ImpDoubleToSalInt64(double d)
SbxDecimal * ImpCreateDecimal(SbxValues *p)
auto ImpDoubleToByte(double f)
void ImpPutDate(SbxValues *p, double n)
double ImpGetDate(const SbxValues *p)
constexpr auto SbxMINCURR
constexpr auto SbxMAXCURR