HenrikBengtsson / Wishlist-for-R

Features and tweaks to R that I and others would love to see - feel free to add yours!
https://github.com/HenrikBengtsson/Wishlist-for-R/issues
GNU Lesser General Public License v3.0
134 stars 4 forks source link

Underscore `_` as digit separator #133

Open t-wojciech opened 2 years ago

t-wojciech commented 2 years ago

In Python (https://peps.python.org/pep-0515/) and Julia (https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/#Floating-Point-Numbers) it is possible to use an underscore _ as a digit separator in numbers.

> 100_000
100000

Do you think such a feature would be worth implementing and helpful in R? I am aware that I can use mathematical notation (1e5 in this example).

t-wojciech commented 2 years ago

Here is a related discussion on R-devel: https://stat.ethz.ch/pipermail/r-devel/2022-July/081874.html

t-wojciech commented 2 years ago

Here is patch proposition on R Bugzilla: https://bugs.r-project.org/show_bug.cgi?id=18407