如何制作数字的单词形式?我有数字并想知道如何将它们转换为字符串?
1 to 1st
2 to 2nd
3 to 3rd
.
.
11 to 11th
.
21 to 21st
etc
答案 0 :(得分:5)
来自?ordinal_format
scales
library(scales)
ordinal_format()(1:10)
# [1] "1st" "2nd" "3rd" "4th" "5th" "6th" "7th" "8th" "9th" "10th"