From 0b99f4abdff9a97584964254f72340232fd4efad Mon Sep 17 00:00:00 2001 From: Roberto Mapelli Date: Mon, 16 Jan 2017 17:52:32 +0100 Subject: [PATCH] Add check to first and second character for large numbers as string --- src/WebHelpers.bas | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/WebHelpers.bas b/src/WebHelpers.bas index 32cf44e8..6c81313d 100644 --- a/src/WebHelpers.bas +++ b/src/WebHelpers.bas @@ -2563,6 +2563,16 @@ Private Function json_StringIsLargeNumber(json_String As Variant) As Boolean json_StringIsLargeNumber = True + ' In the fisrt char is 0 the second must be . to be a large number + ' otherwise it's a string + Dim first_Char, second_Char As Integer + first_Char = VBA.Asc(VBA.Mid$(json_String, 1, 1)) + second_Char = VBA.Asc(VBA.Mid$(json_String, 2, 1)) + If first_Char = 48 And second_Char <> 46 Then + json_StringIsLargeNumber = False + Exit Function + End If + For json_CharIndex = 1 To json_Length json_CharCode = VBA.Asc(VBA.Mid$(json_String, json_CharIndex, 1)) Select Case json_CharCode