Changeset 2703


Ignore:
Timestamp:
Feb 16, 2011, 10:34:04 AM (11 years ago)
Author:
nolte
Message:

added thousands separator for high values in Statistic Information

Location:
trunk/CrypPlugins/KeySearcher
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r2702 r2703  
    13611361                var timenow = DateTime.UtcNow;
    13621362
    1363                 var diff = (BigInteger) timenow.Subtract(memTime).TotalSeconds;
    1364                 if(diff > 0)
    1365                 {
    1366                    ((QuickWatch) QuickWatchPresentation).StatisticsPresentation.SetCurrentRate = (keysnow - memKeys) /
    1367                                                                                               ((BigInteger)timenow.Subtract(memTime).TotalSeconds);
     1363                var difftime = (BigInteger) timenow.Subtract(memTime).TotalSeconds;
     1364                var diffkeys = keysnow - memKeys;
     1365
     1366                if ((difftime > 0) && (diffkeys > 0))
     1367                {
     1368                   ((QuickWatch) QuickWatchPresentation).StatisticsPresentation.SetCurrentRate = diffkeys / difftime;
    13681369                }
    13691370                memKeys = keysnow;
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml.cs

    r2685 r2703  
    169169                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    170170                {
    171                     TotalAmountOfBlocks.Content = totalBlocks;
     171                    TotalAmountOfBlocks.Content = string.Format("{0:0,0}", totalBlocks);
    172172                }, null);
    173173            }
     
    187187                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    188188                {
    189                     TotalBlocksTested.Content = calculatedBlocks;
     189                    TotalBlocksTested.Content = string.Format("{0:0,0}", calculatedBlocks);
    190190                }, null);
    191191            }
     
    205205                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    206206                {
    207                     TotalAmountOfKeys.Content = totalKeys;
     207                    TotalAmountOfKeys.Content = string.Format("{0:0,0}", totalKeys);
    208208                }, null);
    209209            }
     
    223223                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    224224                {
    225                     TotalKeysTested.Content = calculatedKeys;
     225                    TotalKeysTested.Content = string.Format("{0:0,0}", calculatedKeys);
    226226                }, null);
    227227            }
     
    400400                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    401401                {
    402                     Rate.Content = rate + " key/sec";
     402                    Rate.Content = string.Format("{0:0,0} key/sec", rate);
    403403                }, null);
    404404            }
     
    418418                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    419419                {
    420                     CurrentRate.Content = currentrate + " key/sec";
     420                    CurrentRate.Content = string.Format("{0:0,0} key/sec", currentrate);
    421421                }, null);
    422422            }
Note: See TracChangeset for help on using the changeset viewer.