mattn <[email protected]> wrote:

> Hi list.
>
> round(n) should take digits to round up with second argument.
>
> round(5.127)    -> 5.0
> round(5.127,-1) -> 10.0

I don't understand this example. What does it mean
when the second parameter is a negative value?
The help file does not say anything about it.

> round(5.127,0)  -> 5.0
> round(5.127,1)  -> 5.1
> round(5.127,2)  -> 5.13
> round(5.127,3)  -> 5.127
>
> below is a patch to add second argument {digit} into round().
>
> https://gist.github.com/mattn/8591d5316b990fc4d7d5

The help file runtime/doc/eval.txt gives those examples
and the last one looks incorrect:

             echo round(4.5)
 <            5.0 >
             echo round(-4.5)
<            -5.0 >
            echo round(4.583, 2)
 <            -5.0

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui