There was an error while loading. Please reload this page.
1 parent 7e65912 commit af9c3caCopy full SHA for af9c3ca
1 file changed
codonPython/suppression.py
@@ -1 +1,36 @@
1
-import math
+def suppress_value(valuein: int, rc:str = '*')->str:
2
+ """
3
+ Suppress values less than or equal to 7
4
+
5
+ This function takes the metric value and suppresses it if it is less than or equal to 7.
6
+ If the metric value is 0 then it will remain as 0.
7
8
+ Parameters
9
+ ----------
10
+ valuein : int
11
+ Metric value
12
+ rc : str
13
+ Replacement character if value needs suppressing
14
15
+ Returns
16
+ -------
17
+ out : str
18
+ Suppressed value (*), 0 or valuein if greater than 7
19
20
+ Examples
21
+ --------
22
+ >>> suppress_value(3)
23
+ '*'
24
+ >>> suppress_value(24)
25
+ '24'
26
+ >>> suppress_value(0)
27
+ '0'
28
29
30
+ if valuein ==0:
31
+ valueout = str(valuein)
32
+ if 1 <= valuein <= 7:
33
+ valueout = rc
34
+ if valuein >7:
35
36
+ return valueout
0 commit comments