From 2a56855b26ec09098957f83611e2c30277283d36 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 1 Mar 2024 22:22:13 +0200 Subject: Add gnosis-algorithm-round-items --- gnosis-algorithm.el | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnosis-algorithm.el') 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). -- cgit v1.2.3