tests/testthat/_snaps/xlr_percent.md

xlr_percent.format prints the way we want it

Code
  xlr_percent(1:100 / 100)
Output
  <xlr_percent[100]>
    [1] 1%   2%   3%   4%   5%   6%   7%   8%   9%   10%  11%  12%  13%  14%  15% 
   [16] 16%  17%  18%  19%  20%  21%  22%  23%  24%  25%  26%  27%  28%  29%  30% 
   [31] 31%  32%  33%  34%  35%  36%  37%  38%  39%  40%  41%  42%  43%  44%  45% 
   [46] 46%  47%  48%  49%  50%  51%  52%  53%  54%  55%  56%  57%  58%  59%  60% 
   [61] 61%  62%  63%  64%  65%  66%  67%  68%  69%  70%  71%  72%  73%  74%  75% 
   [76] 76%  77%  78%  79%  80%  81%  82%  83%  84%  85%  86%  87%  88%  89%  90% 
   [91] 91%  92%  93%  94%  95%  96%  97%  98%  99%  100%
Code
  xlr_percent(0:99 / 100, dp = 2)
Output
  <xlr_percent[100]>
    [1] 0.00%  1.00%  2.00%  3.00%  4.00%  5.00%  6.00%  7.00%  8.00%  9.00% 
   [11] 10.00% 11.00% 12.00% 13.00% 14.00% 15.00% 16.00% 17.00% 18.00% 19.00%
   [21] 20.00% 21.00% 22.00% 23.00% 24.00% 25.00% 26.00% 27.00% 28.00% 29.00%
   [31] 30.00% 31.00% 32.00% 33.00% 34.00% 35.00% 36.00% 37.00% 38.00% 39.00%
   [41] 40.00% 41.00% 42.00% 43.00% 44.00% 45.00% 46.00% 47.00% 48.00% 49.00%
   [51] 50.00% 51.00% 52.00% 53.00% 54.00% 55.00% 56.00% 57.00% 58.00% 59.00%
   [61] 60.00% 61.00% 62.00% 63.00% 64.00% 65.00% 66.00% 67.00% 68.00% 69.00%
   [71] 70.00% 71.00% 72.00% 73.00% 74.00% 75.00% 76.00% 77.00% 78.00% 79.00%
   [81] 80.00% 81.00% 82.00% 83.00% 84.00% 85.00% 86.00% 87.00% 88.00% 89.00%
   [91] 90.00% 91.00% 92.00% 93.00% 94.00% 95.00% 96.00% 97.00% 98.00% 99.00%
Code
  tibble::tibble(test = xlr_percent(0:99 / 100, dp = 2))
Output
  # A tibble: 100 x 1
        test
     <x_pct>
   1   0.00%
   2   1.00%
   3   2.00%
   4   3.00%
   5   4.00%
   6   5.00%
   7   6.00%
   8   7.00%
   9   8.00%
  10   9.00%
  # i 90 more rows


Try the xlr package in your browser

Any scripts or data that you put into this service are public.

xlr documentation built on April 3, 2025, 6:07 p.m.