From 8ff32f0b4e99815beed70247e650ddd35153914f Mon Sep 17 00:00:00 2001 From: lc4t Date: Sat, 29 Feb 2020 09:03:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- danmu/bili_danmu_giftthx.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/danmu/bili_danmu_giftthx.py b/danmu/bili_danmu_giftthx.py index a4ba264..32f819b 100644 --- a/danmu/bili_danmu_giftthx.py +++ b/danmu/bili_danmu_giftthx.py @@ -272,10 +272,12 @@ async def get_gamestr(self): # 1光秒 299792.458 km if int(self.user.height) < 10**3: height = '%dmm' % (self.user.height) - elif 10**3 <= int(self.user.height) < 10**6: # < 1km + elif 10**3 <= int(self.user.height) < 10**6: # 1m - 1km height = '%.3fm' % (self.user.height/(10**3)) - elif 10**6 <= self.user.height < 299792.458 * (10**6): # < 1光秒 - height = '%.4f光秒' % (self.user.height/(10**6)) + elif 10**6 <= int(self.user.height) < 10**9: # < 1km - 1kkm + height = '%.3fkm' % (self.user.height/(10**6)) + elif 10**9 <= self.user.height < 86400 * 299792458000: # 光天 + height = '%.4f光秒' % (self.user.height/(299792458000)) else: height = '%.5f光年' % (self.user.height/(10**6)/149597870.7) return weight, height