-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add European Number Styling Theme #557
Comments
@larmarange when would you like a space vs a period to separate/style large numbers vv <- c(0.01, 1e5, 107453.354)
# using period to separate big numbers
format(vv, big.mark = ".", decimal.mark = ",", scientific = FALSE)
#> [1] " 0,01" "100.000,00" "107.453,35"
# using space to separate big numbers
format(vv, big.mark = " ", decimal.mark = ",", scientific = FALSE)
#> [1] " 0,01" "100 000,00" "107 453,35" Created on 2020-06-29 by the reprex package (v0.3.0) |
Just a quick link about a similar discussion for
Therefore, I would say that any default behaviour should be a space for separating thousands and a dot for decimals (i.e. default corresponds to international standard). |
According to Wikipedia: https://www.wikiwand.com/en/Decimal_separator#Examples_of_use
|
As you can see, there is no "Europen style" as it is language dependant. This is why I would say that the default is the SI system, and that it will be changed by language theme. It seems that all French speaking counries are using the same "1 234 567,89" but some English speaking countries are not using the US system (e.g. official Canadian approach is the SI one, and Ireland is using a middle-dot and not a dot (like Lancet journal). In that case, if requested by users, you could consider the possibility of |
If you are using
An alternative is to use |
Hi! I agree with @larmarange, in the specific case for spanish language the correct format is: 1.234.567,89 (not 1.234.567'89, as is also stated in the previous table) |
I'll see if I can make some progress/reading for this update this week. It seems there are many official styles and unofficial styles, and they can be different for countries speaking the same language. Perhaps as a starting point, I can create a theme where users can select the number formatting throughout the package. The language theme and the decimal theme can be set separately. |
Maybe the language theme could define the most common format for a specific
language, and additional subthemes for very specific changes.
Joseph Larmarange
Le dim. 5 juil. 2020 à 21:28, Daniel Sjoberg <notifications@github.com> a
écrit :
… I'll see if I can make some progress/reading for this update this week. It
seems there are many official styles and unofficial styles, and they can be
different for countries speaking the same language. Perhaps as a starting
point, I can create a theme where users can select the number formatting
throughout the package. The language theme and the decimal theme can be set
separately.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#557 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHL5I3QXTKOUV4KWCHZ5ITR2DH7PANCNFSM4OKGJ3HQ>
.
|
I added control in the entire package for the formatting of numbers printed, e.g. Pull Request: #566 |
I think that the best default option is the "english format", and, as you stated, offer the option to the user for changing formatting as desired |
I would say that the best default format is the "international" or SI format, i.e. |
Thanks a lot for having added the option to customize directly in Regards |
Hey @larmarange and @oranwutang ! Thank you for your valuable input here. I am going to go ahead and close this issue.
Again many thanks for all your thoughtful comments. |
tbl_summary-fn:N_fun
to style the numbers in gtsummary to European style, e.g.1 000,84
.tbl_summary()
The text was updated successfully, but these errors were encountered: