summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript/Field.cpp')
-rw-r--r--fpdfsdk/src/javascript/Field.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index ebd3d331f5..959e8dcadd 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -2741,8 +2741,13 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
- vp << dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDot)) {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
} else {
vp << swValue;
}
@@ -2764,8 +2769,13 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
- vp << dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDot)) {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
} else {
vp << swValue;
}
@@ -2780,7 +2790,9 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
+ FX_BOOL bDotDummy;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDotDummy)) {
vp << dRet;
} else {
vp << swValue;