-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathaegean.go
38 lines (33 loc) · 929 Bytes
/
aegean.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package ntw
func init() {
// register the language
Languages["aegean"] = Language{
Name: "Aegean",
Aliases: []string{"aegean"},
Flag: "",
IntegerToWords: IntegerToAegean,
}
}
// IntegerToAegean converts an integer to Aegean words
func IntegerToAegean(input int) string {
if input < 0 || input == 0 || input >= 100000 {
return ""
}
output := ""
if i := input / 10000 % 10; i > 0 {
output += string([]rune(" 𐄫𐄬𐄭𐄮𐄯𐄰𐄱𐄲𐄳")[i])
}
if i := input / 1000 % 10; i > 0 {
output += string([]rune(" 𐄢𐄣𐄤𐄥𐄦𐄧𐄨𐄩𐄪")[i])
}
if i := input / 100 % 10; i > 0 {
output += string([]rune(" 𐄙𐄚𐄛𐄜𐄝𐄞𐄟𐄠𐄡")[i])
}
if i := input / 10 % 10; i > 0 {
output += string([]rune(" 𐄐𐄑𐄒𐄓𐄔𐄕𐄖𐄗𐄘")[i])
}
if i := input % 10; i > 0 {
output += string([]rune(" 𐄇𐄈𐄉𐄊𐄋𐄌𐄍𐄎𐄏")[i])
}
return output
}