3
3
4
4
__author__ = "Anubhav Solanki"
5
5
__license__ = "MIT"
6
- __version__ = "1.0 .0"
6
+ __version__ = "1.1 .0"
7
7
__maintainer__ = "Anubhav Solanki"
8
8
9
9
27
27
-> Wikipedia reference: https://en.wikipedia.org/wiki/Ounce
28
28
-> Wikipedia reference: https://en.wikipedia.org/wiki/Fineness#Karat
29
29
-> Wikipedia reference: https://en.wikipedia.org/wiki/Dalton_(unit)
30
+ -> Wikipedia reference: https://en.wikipedia.org/wiki/Stone_(unit)
30
31
"""
31
32
32
33
KILOGRAM_CHART : dict [str , float ] = {
37
38
"long-ton" : 0.0009842073 ,
38
39
"short-ton" : 0.0011023122 ,
39
40
"pound" : 2.2046244202 ,
41
+ "stone" : 0.1574731728 ,
40
42
"ounce" : 35.273990723 ,
41
43
"carrat" : 5000 ,
42
44
"atomic-mass-unit" : 6.022136652e26 ,
50
52
"long-ton" : 1016.04608 ,
51
53
"short-ton" : 907.184 ,
52
54
"pound" : 0.453592 ,
55
+ "stone" : 6.35029 ,
53
56
"ounce" : 0.0283495 ,
54
57
"carrat" : 0.0002 ,
55
58
"atomic-mass-unit" : 1.660540199e-27 ,
@@ -67,6 +70,7 @@ def weight_conversion(from_type: str, to_type: str, value: float) -> float:
67
70
"long-ton" : 0.0009842073,
68
71
"short-ton" : 0.0011023122,
69
72
"pound" : 2.2046244202,
73
+ "stone": 0.1574731728,
70
74
"ounce" : 35.273990723,
71
75
"carrat" : 5000,
72
76
"atomic-mass-unit" : 6.022136652E+26
@@ -85,6 +89,8 @@ def weight_conversion(from_type: str, to_type: str, value: float) -> float:
85
89
0.0011023122
86
90
>>> weight_conversion("kilogram","pound",4)
87
91
8.8184976808
92
+ >>> weight_conversion("kilogram","stone",5)
93
+ 0.7873658640000001
88
94
>>> weight_conversion("kilogram","ounce",4)
89
95
141.095962892
90
96
>>> weight_conversion("kilogram","carrat",3)
@@ -105,6 +111,8 @@ def weight_conversion(from_type: str, to_type: str, value: float) -> float:
105
111
3.3069366000000003e-06
106
112
>>> weight_conversion("gram","pound",3)
107
113
0.0066138732606
114
+ >>> weight_conversion("gram","stone",4)
115
+ 0.0006298926912000001
108
116
>>> weight_conversion("gram","ounce",1)
109
117
0.035273990723
110
118
>>> weight_conversion("gram","carrat",2)
@@ -211,6 +219,24 @@ def weight_conversion(from_type: str, to_type: str, value: float) -> float:
211
219
2267.96
212
220
>>> weight_conversion("pound","atomic-mass-unit",4)
213
221
1.0926372033015936e+27
222
+ >>> weight_conversion("stone","kilogram",5)
223
+ 31.751450000000002
224
+ >>> weight_conversion("stone","gram",2)
225
+ 12700.58
226
+ >>> weight_conversion("stone","milligram",3)
227
+ 19050870.0
228
+ >>> weight_conversion("stone","metric-ton",3)
229
+ 0.01905087
230
+ >>> weight_conversion("stone","long-ton",3)
231
+ 0.018750005325351003
232
+ >>> weight_conversion("stone","short-ton",3)
233
+ 0.021000006421614002
234
+ >>> weight_conversion("stone","pound",2)
235
+ 28.00000881870372
236
+ >>> weight_conversion("stone","ounce",1)
237
+ 224.00007054835967
238
+ >>> weight_conversion("stone","carrat",2)
239
+ 63502.9
214
240
>>> weight_conversion("ounce","kilogram",3)
215
241
0.0850485
216
242
>>> weight_conversion("ounce","gram",3)
0 commit comments