2020-04-14 02:31:36 +02:00
|
|
|
|
from typing import Union
|
2020-03-20 12:22:13 +01:00
|
|
|
|
|
2020-04-14 02:31:36 +02:00
|
|
|
|
NUMBERS = ["\u0030\u20e3", "\u0031\u20e3", "\u0032\u20e3", "\u0033\u20e3", "\u0034\u20e3", "\u0035\u20e3",
|
|
|
|
|
"\u0036\u20e3", "\u0037\u20e3", "\u0038\u20e3", "\u0039\u20e3", "\U0001f51f"]
|
|
|
|
|
MINUS = "\u2796"
|
2020-04-05 12:09:46 +02:00
|
|
|
|
|
2020-04-14 02:31:36 +02:00
|
|
|
|
THUMBS_UP = "\U0001f44d"
|
|
|
|
|
THUMBS_DOWN = "\U0001f44e"
|
|
|
|
|
WHITE_CHECK_MARK = "\u2705"
|
2020-03-20 12:22:13 +01:00
|
|
|
|
|
2020-04-14 02:31:36 +02:00
|
|
|
|
|
|
|
|
|
def write_with_number(i: Union[int, float]):
|
|
|
|
|
"""
|
|
|
|
|
Write number with emoji
|
|
|
|
|
|
|
|
|
|
:Basic usage:
|
|
|
|
|
|
|
|
|
|
>>> write_with_number(23)
|
|
|
|
|
'2⃣3⃣'
|
|
|
|
|
>>> write_with_number(-23)
|
|
|
|
|
'➖2⃣3⃣'
|
|
|
|
|
>>> write_with_number(-23.34)
|
|
|
|
|
'➖2⃣3⃣.3⃣4⃣'
|
|
|
|
|
>>> write_with_number(-1234567890.098)
|
|
|
|
|
'➖1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣0⃣.0⃣9⃣8⃣'
|
|
|
|
|
|
|
|
|
|
:param i: number to write
|
|
|
|
|
:return: string with emojis
|
|
|
|
|
"""
|
2020-03-20 12:22:13 +01:00
|
|
|
|
s = ""
|
|
|
|
|
for c in str(i):
|
2020-04-14 02:31:36 +02:00
|
|
|
|
if c == ".":
|
2020-03-20 12:22:13 +01:00
|
|
|
|
s += "."
|
2020-04-14 02:31:36 +02:00
|
|
|
|
elif c == "-":
|
|
|
|
|
s += MINUS
|
2020-03-20 12:22:13 +01:00
|
|
|
|
else:
|
|
|
|
|
s += NUMBERS[int(c)]
|
|
|
|
|
return s
|