[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: not good proposal: "C-z <letter>" reserved for users
From: |
Emanuel Berg |
Subject: |
Re: not good proposal: "C-z <letter>" reserved for users |
Date: |
Sat, 13 Feb 2021 15:43:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Jean Louis wrote:
> (defun pct-of-number-in-total (number total)
> "Return the percentage that NUMBER represents in a TOTAL."
> (let* ((percent (/ (float total) 100))
> (percentage (/ (float number) percent)))
> percentage))
> (pct-of-number-in-total 13973 204612) yields 6.8290227357144255
(defun percent (n d)
(let ((pct (* 100 (/ n d 1.0))))
(message "%.1f%%" pct)))
(percent 13973 204612) ; 6.8%
One thing I don't understand tho - from the `format' docstring
For %e and %f sequences, the number after the "." in the
precision specifier says how many decimal places to show; if
zero, the decimal point itself is omitted.
Still (percent 0 200) ; 0.0%
Or does that refer to "if one _sets_ it to zero"
(message "%.0f%%" 0) ; 0%
Right, so that's it... Yeah, so obvious, saying it makes one
confused instead :)
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
- Re: not good proposal: "C-z <letter>" reserved for users, (continued)
- Re: not good proposal: "C-z <letter>" reserved for users, Emanuel Berg, 2021/02/12
- Re: not good proposal: "C-z <letter>" reserved for users, Philip Kaludercic, 2021/02/12
- Re: not good proposal: "C-z <letter>" reserved for users, Emanuel Berg, 2021/02/12
- Re: not good proposal: "C-z <letter>" reserved for users, Jean Louis, 2021/02/12
- Re: not good proposal: "C-z <letter>" reserved for users, Emanuel Berg, 2021/02/12
- Re: not good proposal: "C-z <letter>" reserved for users, Robert Thorpe, 2021/02/13
- Re: not good proposal: "C-z <letter>" reserved for users, Jean Louis, 2021/02/13
- Re: not good proposal: "C-z <letter>" reserved for users,
Emanuel Berg <=
- math (was: Re: not good proposal: "C-z <letter>" reserved for users), Emanuel Berg, 2021/02/13
- Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Jean Louis, 2021/02/13
- Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Emanuel Berg, 2021/02/13
- Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Jean Louis, 2021/02/13
- Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Emanuel Berg, 2021/02/13
- Make Super key work in console - was Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Jean Louis, 2021/02/13
- Re: Make Super key work in console - was Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Emanuel Berg, 2021/02/13
- Re: Make Super key work in console - was Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Jean Louis, 2021/02/13
- Re: Make Super key work in console - was Re: math (was: Re: not good proposal: "C-z <letter>" reserved for users), Emanuel Berg, 2021/02/13
- OT: more praise to Tramp - was: Re: Make Super key work in console - was Re: math, ken, 2021/02/16