Skip to content

Commit 4fb3c62

Browse files
committed
Update convert_currency docs
1 parent 843e70a commit 4fb3c62

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pythainlp/ancient/currency.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,41 @@ def convert_currency(value: float, from_unit: str) -> dict:
77
"""
88
Convert ancient Thai currency to other units
99
10+
* เบี้ย (Bia)
11+
* อัฐ (At)
12+
* ไพ (Pi)
13+
* เฟื้อง (Feuang)
14+
* สลึง (Saleung)
15+
* บาท (Bath)
16+
* ตำลึง (Tamleung)
17+
* ชั่ง (Chang)
18+
19+
See more:
20+
`Thai money <https://en.wikipedia.org/wiki/History_of_Thai_money>`_.
21+
1022
:param float value: value
1123
:param str from_unit: currency unit \
1224
('เบี้ย', 'อัฐ', 'ไพ', 'เฟื้อง', 'สลึง', 'บาท', 'ตำลึง', 'ชั่ง')
1325
:return: Thai currency
1426
:rtype: dict
27+
28+
:Example:
29+
::
30+
31+
from pythainlp.ancient import convert_currency
32+
33+
print(convert_currency(8, "บาท"))
34+
# output:
35+
# {
36+
# 'เบี้ย': 51200.0,
37+
# 'อัฐ': 512.0,
38+
# 'ไพ': 256.0,
39+
# 'เฟื้อง': 64.0,
40+
# 'สลึง': 32.0,
41+
# 'บาท': 8.0,
42+
# 'ตำลึง': 2.0,
43+
# 'ชั่ง': 0.1
44+
# }
1545
"""
1646
conversion_factors_to_att = {
1747
'เบี้ย': 1,

0 commit comments

Comments
 (0)