JapaneseNumber
Introduction
You can get Japanese style number-strings from Int and UInt extentions.
Requirements
- Platforms
- iOS 10.0+
- macOS 10.12+
- Linux
- Swift 5.0
Installation
CocoaPods
use_frameworks!
target 'target' do
pod 'JapaneseNumber'
end
Example
import JapaneseNumber
print("0.japaneseNumber -> \"\(0.japaneseNumber)\"")
// 0.japaneseNumber -> "〇"
print("1.japaneseNumber -> \"\(1.japaneseNumber)\"")
// 1.japaneseNumber -> "一"
print("2.japaneseNumber -> \"\(2.japaneseNumber)\"")
// 2.japaneseNumber -> "二"
print("3.japaneseNumber -> \"\(3.japaneseNumber)\"")
// 3.japaneseNumber -> "三"
print("4.japaneseNumber -> \"\(4.japaneseNumber)\"")
// 4.japaneseNumber -> "四"
print("5.japaneseNumber -> \"\(5.japaneseNumber)\"")
// 5.japaneseNumber -> "五"
print("6.japaneseNumber -> \"\(6.japaneseNumber)\"")
// 6.japaneseNumber -> "六"
print("7.japaneseNumber -> \"\(7.japaneseNumber)\"")
// 7.japaneseNumber -> "七"
print("8.japaneseNumber -> \"\(8.japaneseNumber)\"")
// 8.japaneseNumber -> "八"
print("9.japaneseNumber -> \"\(9.japaneseNumber)\"")
// 9.japaneseNumber -> "九"
print("10.japaneseNumber -> \"\(10.japaneseNumber)\"")
// 10.japaneseNumber -> "十"
print("-1.japaneseNumber -> \"\(Int(-1).japaneseNumber)\"")
// -1.japaneseNumber -> "一"
print("5035.japaneseNumber -> \"\(5035.japaneseNumber)\"")
// 5035.japaneseNumber -> "五千三十五"
print("21038250.japaneseNumber -> \"\(21038250.japaneseNumber)\"")
// 21038250.japaneseNumber -> "二千百三万八千二百五十"
print("325568057586.japaneseNumber -> \"\(325568057586.japaneseNumber)\"")
// 325568057586.japaneseNumber -> "三千二百五十五億六千八百五万七千五百八十六"
print("665061443960367.japaneseNumber -> \"\(665061443960367.japaneseNumber)\"")
// 665061443960367.japaneseNumber -> "六百六十五兆六百十四億四千三百九十六万三百六十七"
print("10937969797677893734.japaneseNumber -> \"\(UInt(10937969797677893734).japaneseNumber)\"")
// 10937969797677893734.japaneseNumber -> "千九十三京七千九百六十九兆七千九百七十六億七千七百八十九万三千七百三十四"
Demo
There are demos.