On 2021/01/02 06:57, Yongwei Wu wrote:
> Just do ":help min()", it will tell you:
>
> min({expr}) Return the minimum value of all items in {expr}.
> {expr} can be a |List| or a |Dictionary|.
>
> So the simplest solution seems to be:
>
> trunc(min([3, float2nr(1+log(1+line('$'))/log(10))]))
>
---
Thanks, when I typed ":help min()", I got
min({list}), and didn't know if the curly braces, "{}"
were needed, but never would have guess I needed
square brackets "[]".
I had 'trunc' to convert from float to a truncated
integer, but notice that you are using "float2nr".
Didn't know I would have needed that either (I had
used the output of 'printf' to go from a number to
a string.
Thanks for the hints and, especially, the example.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5FF25BC2.8020208%40tlinx.org.
Sunday, January 3, 2021
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment