summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-03-01 22:22:13 +0200
committerThanos Apollo <[email protected]>2024-03-01 22:22:13 +0200
commit2a56855b26ec09098957f83611e2c30277283d36 (patch)
treec77f53b50ee9b153a4b5ef09724cc7349fd7558a
parent249cb3338eff23c98b510cded42959332a8b7b5a (diff)
Add gnosis-algorithm-round-items
-rw-r--r--gnosis-algorithm.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el
index da9a070..35248b9 100644
--- a/gnosis-algorithm.el
+++ b/gnosis-algorithm.el
@@ -80,6 +80,10 @@ NOTE: Do not change this value above 1"
for i from 0
collect (if (= i index) new-item item)))
+(defun gnosis-algorithm-round-items (list)
+ "Round all items in LIST to 2 decimal places."
+ (cl-loop for item in list
+ collect (/ (round (* item 100)) 100.0)))
(defun gnosis-algorithm-date (&optional offset)
"Return the current date in a list (year month day).