如何制作数字的单词形式?我有数字,想知道如何将它们转换为字符串?
1 to 1st
2 to 2nd
3 to 3rd
.
.
11 to 11th
.
21 to 21st
etc
Run Code Online (Sandbox Code Playgroud)
从示例?ordinal_format中scales
library(scales)
ordinal_format()(1:10)
# [1] "1st" "2nd" "3rd" "4th" "5th" "6th" "7th" "8th" "9th" "10th"
Run Code Online (Sandbox Code Playgroud)