2025-10-06 20:29:36 +11:00
|
|
|
fun toInt in {
|
|
|
|
|
assert $in is <String>
|
|
|
|
|
let retint = 0
|
|
|
|
|
let counter = 0
|
|
|
|
|
let power = ($in size)
|
|
|
|
|
let size = ($in size)
|
|
|
|
|
while compare $counter < $size {
|
|
|
|
|
let char = ($in $counter)
|
|
|
|
|
power = (math $power - 1)
|
|
|
|
|
if compare $char == "1" {
|
|
|
|
|
retint = (math $retint + (math 1 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "2" {
|
|
|
|
|
retint = (math $retint + (math 2 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "3" {
|
|
|
|
|
retint = (math $retint + (math 3 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "4" {
|
|
|
|
|
retint = (math $retint + (math 4 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "5" {
|
|
|
|
|
retint = (math $retint + (math 5 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
|
|
|
|
if compare $char == "6" {
|
2025-10-06 20:29:36 +11:00
|
|
|
retint = (math $retint + (math 6 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "7" {
|
|
|
|
|
retint = (math $retint + (math 7 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "8" {
|
|
|
|
|
retint = (math $retint + (math 8 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "9" {
|
|
|
|
|
retint = (math $retint + (math 9 * 10 ^ $power))
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
if compare $char == "0" {
|
|
|
|
|
# whole lotta nothing
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
counter = (math $counter + 1)
|
|
|
|
|
|
2025-10-07 10:15:59 +11:00
|
|
|
}
|
2025-10-06 20:29:36 +11:00
|
|
|
return $retint
|
|
|
|
|
}
|
|
|
|
|
let myInt = (toInt "4738927643289")
|
|
|
|
|
|
|
|
|
|
println $myInt
|