diff --git a/lisp/org-colview.el b/lisp/org-colview.el index b88cb77e0..251f42520 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1068,7 +1068,7 @@ display, or in the #+COLUMNS line of the current buffer." (defun org-nofm-to-completion (n m &optional percent) (if (not percent) (format "[%d/%d]" n m) - (format "[%d%%]"(floor (+ 0.5 (* 100. (/ (* 1.0 n) m))))))) + (format "[%d%%]" (round (* 100.0 n) m)))) (defun org-columns-string-to-number (s fmt) diff --git a/lisp/org-list.el b/lisp/org-list.el index ee9d7c141..b23f49bbf 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2573,7 +2573,8 @@ With optional prefix argument ALL, do this for the whole buffer." (total (nth 4 cookie))) (goto-char beg) (insert - (if percent (format "[%d%%]" (/ (* 100 checked) (max 1 total))) + (if percent (format "[%d%%]" (floor (* 100.0 checked) + (max 1 total))) (format "[%d/%d]" checked total))) (delete-region (point) (+ (point) (- end beg))) (when org-auto-align-tags (org-fix-tags-on-the-fly))))))) diff --git a/lisp/org.el b/lisp/org.el index a49c1da47..b6f1da738 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -4549,7 +4549,8 @@ is nil, return nil unconditionally." (goto-char (point-min)) (while (re-search-forward org-table-any-line-regexp nil t) (unless quietly - (message "Mapping tables: %d%%" (/ (* 100.0 (point)) (buffer-size)))) + (message "Mapping tables: %d%%" + (floor (* 100.0 (point)) (buffer-size)))) (beginning-of-line 1) (when (and (looking-at org-table-line-regexp) ;; Exclude tables in src/example/verbatim/clocktable blocks @@ -12966,7 +12967,8 @@ statistics everywhere." (outline-next-heading))) (setq new (if is-percent - (format "[%d%%]" (/ (* 100 cnt-done) (max 1 cnt-all))) + (format "[%d%%]" (floor (* 100.0 cnt-done) + (max 1 cnt-all))) (format "[%d/%d]" cnt-done cnt-all)) ndel (- (match-end 0) checkbox-beg)) ;; handle overlays when updating cookie from column view