countryscales 0.3.0
Initial CRAN release.
-
label_number_locale(),label_percent_locale(), andlabel_currency_locale()format numbers, percentages, and currencies using the conventions of any of several hundred locales from the Unicode Common Locale Data Repository (CLDR), sourced via thei18npackage — thousands separator, decimal mark, currency symbol placement, and sign placement all follow the target locale. Locales using the Indian numbering system (grouping by threes then twos) are not supported, as they deviate from the standard grouping this package implements. - Dedicated
_de(),_ch(), and_us()wrapper families (e.g.label_number_de(),label_percent_ch(),label_currency_us()) provide ready-to-use formatters for Germany, Switzerland, and the United States. -
label_number_xx()/label_percent_xx()/label_currency_xx()and theirscale_x/y_number/percent/currency_xx()counterparts additionally cover 24 more locales (#4): France (fr), the United Kingdom (gb), Italy (it), Spain (es), Austria (at), Ireland (ie), Portugal (pt), Sweden (se), Norway (no), Finland (fi), Denmark (dk), Brazil (br), Argentina (ar), Mexico (mx), Canada (ca), Japan (jp), China (cn), Indonesia (id), South Korea (kr), Australia (au), Saudi Arabia (sa), South Africa (za), Turkey (tr), and Russia (ru) — every G20 member except India, whose Indian numbering system isn’t supported (see above). -
scale_x_number_locale()/scale_y_number_locale()and their_percent_/_currency_and_de/_ch/_uscounterparts labelggplot2axes directly using the same locale-aware formatting. -
show_locales()lists all supported locale codes. - Fixed
scale_cut(e.g.scale_cut = scales::cut_short_scale(), for “1K”/“1M”-style suffixes), which is accepted bylabel_number_locale()andlabel_currency_locale()(and so by every_xx()wrapper) but always errored when actually used, due to an internal naming collision. - Fixed a latent bug in currency formatting where a locale with a non-empty positive sign could have had that sign doubled on positive amounts. Invisible for every currently supported locale (all have an empty positive sign), but incorrect in principle — now fixed.
