mirror of
https://github.com/Redume/Shirino.git
synced 2024-11-24 09:16:22 +03:00
сделал формат чисел, чтобы 1300 форматировалось в 1 300
This commit is contained in:
parent
019f844e4f
commit
43ffa88642
1 changed files with 3 additions and 2 deletions
5
main.py
5
main.py
|
@ -11,6 +11,7 @@ import re
|
||||||
|
|
||||||
from word2number import w2n
|
from word2number import w2n
|
||||||
from function.convert import Converter
|
from function.convert import Converter
|
||||||
|
from function.format_number import format_number
|
||||||
|
|
||||||
config = yaml.safe_load(open("config.yaml"))
|
config = yaml.safe_load(open("config.yaml"))
|
||||||
dp = Dispatcher()
|
dp = Dispatcher()
|
||||||
|
@ -69,7 +70,7 @@ async def message_conv(message: types.Message):
|
||||||
conv.conv_currency = target_currency_code.upper()
|
conv.conv_currency = target_currency_code.upper()
|
||||||
conv.convert()
|
conv.convert()
|
||||||
|
|
||||||
result = f'{conv.amount} {conv.from_currency} = {conv.conv_amount} {conv.conv_currency}'
|
result = f'{format_number(conv.amount)} {conv.from_currency} = {conv.conv_amount} {conv.conv_currency}'
|
||||||
await message.reply(result)
|
await message.reply(result)
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,7 +118,7 @@ async def currency(inline_query: types.InlineQuery) -> None:
|
||||||
conv.convert()
|
conv.convert()
|
||||||
|
|
||||||
result = (
|
result = (
|
||||||
f'{conv.amount} {conv.from_currency} = '
|
f'{format_number(conv.amount)} {conv.from_currency} = '
|
||||||
f'{conv.conv_amount} {conv.conv_currency}'
|
f'{conv.conv_amount} {conv.conv_currency}'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue