Yasuhiro Matsumoto 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
> 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
I suppose it's useful sometimes. Although it can be done a multiply and
divide (which is how it's implemented).
The documentaiton doesn't explain what {digits} is for, there is only an
example.
--
If the Universe is constantly expanding, why can't I ever find a parking space?
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.