Move functions from round-number-to-decimals.el to the Org config

This commit is contained in:
2018-07-30 20:02:49 +02:00
parent 38dd27dc1e
commit 50ec5643de
3 changed files with 26 additions and 18 deletions

View File

@@ -1,17 +0,0 @@
(defun get-number-at-point ()
(interactive)
(skip-chars-backward "0123456789.-")
(or (looking-at "[0123456789.-]+")
(error "No number at point"))
(string-to-number (match-string 0)))
(defun round-number-at-point-to-decimals (decimal-count)
(interactive "NDecimal count: ")
(let ((mult (expt 10 decimal-count)))
(replace-match (number-to-string
(/
(fround
(*
mult
(get-number-at-point)))
mult)))))