diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-05-22 19:44:53 +0100 |
---|---|---|
committer | Sean Dewar <seandewar@users.noreply.github.com> | 2021-09-11 15:33:20 +0100 |
commit | 6617629ad6eceeb77d49633780a7213eeb17a2c9 (patch) | |
tree | 9788c7d628daf61d19466d64d1bdec9279b3dc39 /runtime/doc/eval.txt | |
parent | dda977f5c4d2fc81a0582fbaec7a6397aaf7aebf (diff) | |
download | rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.tar.gz rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.tar.bz2 rneovim-6617629ad6eceeb77d49633780a7213eeb17a2c9.zip |
vim-patch:8.1.2035: recognizing octal numbers is confusing
Problem: Recognizing octal numbers is confusing.
Solution: Introduce scriptversion 4: do not use octal and allow for single
quote inside numbers.
https://github.com/vim/vim/commit/60a8de28d11595f4df0419ece8afa7d6accc9fbd
:scriptversion is N/A.
Cherry-pick Test_readfile_binary() from v8.1.0742.
Note that this patch was missing vim_str2nr() changes, and so fails the
tests; this was fixed in v8.1.2036.
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r-- | runtime/doc/eval.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 211774ad2d..cd449a5d34 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2508,7 +2508,8 @@ stdpath({what}) String/List returns the standard path(s) for {w str2float({expr}) Float convert String to Float str2list({expr} [, {utf8}]) List convert each character of {expr} to ASCII/UTF8 value -str2nr({expr} [, {base}]) Number convert String to Number +str2nr({expr} [, {base} [, {quoted}]]) + Number convert String to Number strchars({expr} [, {skipcc}]) Number character length of the String {expr} strcharpart({str}, {start} [, {len}]) String {len} characters of {str} at @@ -8637,9 +8638,11 @@ str2list({expr} [, {utf8}]) *str2list()* < Can also be used as a |method|: > GetString()->str2list() -str2nr({expr} [, {base}]) *str2nr()* +str2nr({expr} [, {base} [, {quoted}]]) *str2nr()* Convert string {expr} to a number. {base} is the conversion base, it can be 2, 8, 10 or 16. + When {quoted} is present and non-zero then embedded single + quotes are ignored, thus "1'000'000" is a million. When {base} is omitted base 10 is used. This also means that a leading zero doesn't cause octal conversion to be used, as |