فهرست منبع

Format error / bug

Foppe Hemminga 6 سال پیش
والد
کامیت
4ad2fdd2d5
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 1
      main.py
  2. 1 1
      view.py

+ 2 - 1
main.py

@@ -30,7 +30,8 @@ def process_drop(this_stock):
     stock_name = this_stock[0]
     stock_name = this_stock[0]
     npc_drop = False
     npc_drop = False
     total_stocks = data_latest.total_shares
     total_stocks = data_latest.total_shares
-    previous_available_shares = str(data_latest.available_shares)+' / '+str(data_latest.total_shares)
+    previous_available_shares = '{:,} / {:,}'.format(data_latest.available_shares,
+                                                               data_latest.total_shares)
     if model.is_npc_drop(data_previous, data_latest):
     if model.is_npc_drop(data_previous, data_latest):
         npc_drop = True
         npc_drop = True
     message = view.create_message(
     message = view.create_message(

+ 1 - 1
view.py

@@ -22,7 +22,7 @@ def create_message(name, timestamp, price, quantity, current_quantity=0, forecas
     npc = ''
     npc = ''
     if npc_drop:
     if npc_drop:
         npc = '*NPC* '
         npc = '*NPC* '
-    this_message = "{}: {}{} dropped {:,} shares at ${:,.2f} for a grand total of ${:,.1f}B [{:,}]".format(
+    this_message = "{}: {}{} dropped {:,} shares at ${:,.2f} for a grand total of ${:,.1f}B [{}]".format(
         this_time, npc, name, quantity, price, this_drop_decimal, current_quantity)
         this_time, npc, name, quantity, price, this_drop_decimal, current_quantity)
     if forecast_previous and forecast_latest:
     if forecast_previous and forecast_latest:
         this_message = "{}: {} changed from {} to {} with {:,} shares available at ${:,.2f}".format(
         this_message = "{}: {} changed from {} to {} with {:,} shares available at ${:,.2f}".format(