Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Jan 30, 2024
1 parent 3a52ffb commit 324ed58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/Common/NMR_StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ namespace NMR {
{
throw CNMRException(NMR_ERROR_EMPTYSTRINGTODOUBLECONVERSION);
}
else if (answer.ptr && answer.ptr[0] == ',') // Invalidate comma as decimal separator
else if (answer.ptr) // Invalidate comma as decimal separator
{
throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION);
if (answer.ptr[0] == ',')
{
throw CNMRException(NMR_ERROR_INVALIDSTRINGTODOUBLECONVERSION);
}
}

if ((dResult == HUGE_VAL) || (dResult == -HUGE_VAL))
throw CNMRException(NMR_ERROR_STRINGTODOUBLECONVERSIONOUTOFRANGE);

Expand Down

0 comments on commit 324ed58

Please sign in to comment.