
V
Publisher
verillious
Number To Words (Godot 4)
Misc
GDScript Conversion Numbers Text Output Example Documentation Beginner
Convert numbers to words in GDScript.
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
š Number To Words
Convert numbers to words in GDScript
Check out year of our lord for an example of it working in the wild!
šļø Usage
NumberToWords.to_words(number) -> String
print(NumberToWords.to_words(1111000000))
> "one billion, one hundred and eleven million"
print(NumberToWords.to_words(12.5))
> "twelve point five"
print(NumberToWords.to_words(-12.59))
> "minus twelve point five nine"
print(NumberToWords.to_words(89_000))
> "eighty nine thousand"
print(NumberToWords.to_words(0x8f51))
> "thirty six thousand, six hundred and eighty nine"
print(NumberToWords.to_words(0b101010))
> "forty two"
print(NumberToWords.to_words(58.1e-2))
> "point five eight one"
NumberToWords.to_ordinal(number: int) -> String
print(NumberToWords.to_ordinal(1))
> "first"
print(NumberToWords.to_ordinal(22))
> "twenty second"
print(NumberToWords.to_ordinal(1003))
> "one thousand and third"
NumberToWords.to_ordinal_number(number: int) -> String
print(NumberToWords.to_ordinal_number(1))
> "1st"
print(NumberToWords.to_ordinal_number(22))
> "22nd"
print(NumberToWords.to_ordinal_number(1003))
> "1003rd"
NumberToWords.to_year(number: int) -> String
print(NumberToWords.to_year(1990))
> "nineteen ninety"
print(NumberToWords.to_year(2017))
> "twenty seventeen"
print(NumberToWords.to_year(1066))
> "ten sixty six"
print(NumberToWords.to_year(1865))
> "eighteen sixty five"
print(NumberToWords.to_year(2001))
> "two thousand and one"
print(NumberToWords.to_year(1901))
> "nineteen oh one"
š Credits
šŖ This project was created with cookiecutter and the verillious/cookiecutter-godot project template.
šØ Icon created by Freepik - Flaticon