Rimmon 2 anos atrás
pai
commit
0130729844
3 arquivos alterados com 14 adições e 54 exclusões
  1. 2 1
      Models/Blockchain.cs
  2. 7 50
      Pages/Blockchains.razor
  3. 5 3
      Pages/ModalAssets.razor

+ 2 - 1
Models/Blockchain.cs

@@ -346,7 +346,7 @@ namespace HyperCube.Models
         {
             var ret = await RunFunction("eth_getBalance", $"\"{address}\",\"latest\"");
             var balanceWei = AccountModel.ConvertBalance(ret);
-            var balanceToken = (double)balanceWei / 1000000000000000000.0;
+            var balanceToken = Math.Round((double)balanceWei / 1000000000000000000.0, 4);
             Console.WriteLine($"GetBalance balanceToken {balanceToken}");
             balance = balanceToken.ToString();
             return balance;
@@ -538,6 +538,7 @@ namespace HyperCube.Models
         public string[] ParseStringAnswer(string answer)
         {
             var ret = new string[] { };
+            Console.WriteLine($"ParseStringAnswer: {name},  answer.Length " + answer.Length);
             if (answer.Length > 2)
             {
                 answer = answer.Substring(2, answer.Length - 2);

Diferenças do arquivo suprimidas por serem muito extensas
+ 7 - 50
Pages/Blockchains.razor


+ 5 - 3
Pages/ModalAssets.razor

@@ -35,10 +35,11 @@
                             </div>
                         </div>
                     </div>
+                    <div><p>@_account.Name</p></div>
                     <div class="modal__body__calc__balance__numbers">
                         <div class="modal__body__calc__balance__numbers__name">
-                            <p>Аккаунт @_account.Name</p>
-                        </div>
+                            <p>Ваш</p>
+                        </div>                        
                         <div class="modal__body__calc__balance__numbers__value">
                             <div class="modal__body__calc__balance__numbers__value__item">
                                 <p>@ethBalance</p>
@@ -116,7 +117,8 @@
         set { fi = value;
             if (!counter)
             {
-                var val = System.Convert.ToSingle(fi);
+                var val = float.Parse(fi, System.Globalization.CultureInfo.InvariantCulture);
+                //var val = System.Convert.ToSingle(fi);
                 val *= 5;
                 toInput = val.ToString();
             }