Convert integer to words

前端 未结 2 854
说谎
说谎 2020-12-04 03:12

For the purpose of styling data visualizations, I\'d like to be able to display an integer using words (e.g.

\"Two thousand and seventeen\"

2条回答
  •  日久生厌
    2020-12-04 03:53

    Option 1:

    Use the as.english function from the 'english' package:

    library(english)
    
    as.english(2017)
    


    Option 2:

    Use the replace_number function from the 'qdap' package.

    library(qdap)
    
    replace_number(2017)
    


    Option 3:

    Use the numbers_to_words function from the 'xfun' package.

    library(xfun)
    
    numbers_to_words(2017)
    

提交回复
热议问题