diff --git a/src/application/ljv.application.version.pas b/src/application/ljv.application.version.pas index c818859..527a3c0 100644 --- a/src/application/ljv.application.version.pas +++ b/src/application/ljv.application.version.pas @@ -29,11 +29,11 @@ interface const - cVersion = '0.1.9.34'; + cVersion = '0.1.9.36'; cVersionMajor = 0; cVersionMinor = 1; cVersionRevision = 9; - cVersionBuild = 35; + cVersionBuild = 36; implementation diff --git a/src/forms/ljv.forms.main.pas b/src/forms/ljv.forms.main.pas index 9b9842f..ab13a04 100644 --- a/src/forms/ljv.forms.main.pas +++ b/src/forms/ljv.forms.main.pas @@ -105,6 +105,8 @@ TfrmMain = class(TForm) procedure UpdateTreeFromNode(const ANode: PVirtualNode; const AJSONData: TJSONData; const APath: String); procedure ShowValue(const AJSONData: TJSONData); + function MyIntegerToBinary(const AInteger: Int64; + const ADigits: Integer): String; public end; @@ -924,7 +926,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); edt.Text:= Format('%d', [AJSONData.AsInteger]); edtFormated.Text:= FormatFloat(cNumberFormatInteger, AJSONData.AsFloat); edtScientific.Text:= FormatFloat(cNumberFormatFloatScientific, AJSONData.AsFloat); - edtBin.Text:= IntToBin(AJSONData.AsInt64, 32); + edtBin.Text:= MyIntegerToBinary(AJSONData.AsInt64, 32); edtHex.Text:= IntToHex(AJSONData.AsInteger, 16); edtBytes.Text:= FormatBytes(AJSONData.AsInteger); edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsInteger)); @@ -933,7 +935,7 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); edt.Text:= Format('%d', [AJSONData.AsInt64]); edtFormated.Text:= FormatFloat(cNumberFormatInteger, AJSONData.AsFloat); edtScientific.Text:= FormatFloat(cNumberFormatFloatScientific, AJSONData.AsFloat); - edtBin.Text:= IntToBin(AJSONData.AsInt64, 64); + edtBin.Text:= MyIntegerToBinary(AJSONData.AsInt64, 64); edtHex.Text:= IntToHex(AJSONData.AsInt64, 16); edtBytes.Text:= FormatBytes(AJSONData.AsInt64); edtDateTime.Text:= FormatDateTime(cDateTimeFormat, UnixToDateTime(AJSONData.AsInt64)); @@ -989,5 +991,26 @@ procedure TfrmMain.ShowValue(const AJSONData: TJSONData); end; end; +function TfrmMain.MyIntegerToBinary(const AInteger: Int64; + const ADigits: Integer): String; +var + str: String; + idx: Integer; +begin + Result:= ''; + str:= IntToBin(AInteger, ADigits); + for idx:= 1 to Length(str) do + begin + if (idx mod 4 = 0) and (idx <> Length(str)) then + begin + Result:= ' ' +str[Succ(Length(str)) - idx] + Result; + end + else + begin + Result:= str[Succ(Length(str)) - idx] + Result; + end; + end; +end; + end. diff --git a/src/lazJSONViewer.lpi b/src/lazJSONViewer.lpi index b020759..e5d01ba 100644 --- a/src/lazJSONViewer.lpi +++ b/src/lazJSONViewer.lpi @@ -26,7 +26,7 @@ - +